Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement error handling for fit error metrics plots #272

Merged
merged 7 commits into from
Nov 28, 2024

Conversation

QuantumChemist
Copy link
Collaborator

@QuantumChemist QuantumChemist commented Nov 26, 2024

With too little fit data, the following error occurs:

Traceback (most recent call last):                                                                                                            │
│                File "/user/miniconda3/envs/auto/lib/python3.11/site-packages/jobflow_remote/jobs/run.py", line 49, in run_remote_job    │
│                  response = job.run(store=store)                                                                                                           │
│                             ^^^^^^^^^^^^^^^^^^^^                                                                                                           │
│                File "/user/miniconda3/envs/auto/lib/python3.11/site-packages/jobflow/core/job.py", line 600, in run                     │
│                  response = function(*self.function_args, **self.function_kwargs)                                                                          │
│                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                          │
│                File "/user/miniconda3/envs/auto/lib/python3.11/site-packages/autoplex/fitting/common/jobs.py", line 99, in              │
│              machine_learning_fit                                                                                                                          │
│                  train_test_error = gap_fitting(                                                                                                           │
│                                     ^^^^^^^^^^^^                                                                                                           │
│                File "/user/miniconda3/envs/auto/lib/python3.11/site-packages/autoplex/fitting/common/utils.py", line 232, in            │
│              gap_fitting                                                                                                                                   │
│                  plot_energy_forces(                                                                                                                       │
│                File "/user/miniconda3/envs/auto/lib/python3.11/site-packages/autoplex/data/common/utils.py", line 813, in               │
│              plot_energy_forces                                                                                                                            │
│                  energy_rmse_train = energy_plot(                                                                                                          │
│                                      ^^^^^^^^^^^^                                                                                                          │
│                File "/user/miniconda3/envs/auto/lib/python3.11/site-packages/autoplex/data/common/utils.py", line 646, in energy_plot   │
│                  elim = (for_limits.min() - 0.01, for_limits.max() + 0.01)                                                                                 │
│                          ^^^^^^^^^^^^^^^^                                                                                                                  │
│                File "/user/miniconda3/envs/auto/lib/python3.11/site-packages/numpy/core/_methods.py", line 45, in _amin                 │
│                  return umr_minimum(a, axis, None, out, keepdims, initial, where)                                                                          │
│                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                          │
│              ValueError: zero-size array to reduction operation minimum which has no identity      

which only effects the GAP vs. DFT error metric plots.
The generated GAP potentials themselves looked fine in my test cases.
Therefore, I added a ValueError exception so that the workflow continues. The plots can be generated from GAP and QUIP data afterwards with the respective autoplex metrics functions if needed.

  • replaced prints with logging
  • one small edit to the README as part of the GitHub demo for @celinehalkali

@QuantumChemist QuantumChemist marked this pull request as ready for review November 26, 2024 17:55
@QuantumChemist
Copy link
Collaborator Author

@JaGeo , this PR would be ready for review and merging. 😃

@QuantumChemist QuantumChemist merged commit e48bd5e into autoatml:main Nov 28, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants