-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add diatomics module for generating atomic pair-repulsion curves - diatomics.py has functions to generate diatomic molecules and calculate potential energy and forces - test_diatomics.py tests molecule generation and energy/force results - support both homo-nuclear and hetero-nuclear diatomics * add cli.py with central argument parser for plotting scripts - support command-line configuration for models, test subsets, energy types, and plot options - add corresponding test suite in `test_cli.py` - ensure compatible with unknown sys.argv from Jupyter kernel - update DataFiles and Model enums to use `auto()` and tuple-based file path specification - add test cases for MbdKey, Task, ModelType, Open, and TestSubset enums * move all enums into enums.py: Files, DataFiles and Model enums were in data.py before improves code org * add metrics_df_from_yaml() function in metrics/__init__.py to extract metrics from model YAML files - metrics_df_from_yaml used to be get_df_metrics() in scripts/evals/discovery.py - move df_metrics, df_metrics_10k, df_metrics_uniq_protos from preds/discovery.py to metrics/discovery.py - add test_metrics_init.py to cover metrics_df_from_yaml() - add test_discovery_preds.py to cover df_preds, df_each_pred, df_each_err - update plot scripts to use YAML-read metrics instead of expensive on-the-fly calculated df_metrics{_test_subset} * fix mypy and plotting scripts still importing models from matbench_discovery.preds.discovery.models
- Loading branch information
Showing
91 changed files
with
1,580 additions
and
1,144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
"""Central argument parser for Matbench Discovery scripts.""" | ||
|
||
import argparse | ||
|
||
from pymatviz.enums import Key | ||
|
||
from matbench_discovery.enums import Model, TestSubset | ||
|
||
cli_parser = argparse.ArgumentParser( | ||
description="CLI flags for plotting and analysis scripts." | ||
) | ||
plot_group = cli_parser.add_argument_group( | ||
"plot", "Arguments for controlling figure generation" | ||
) | ||
plot_group.add_argument( | ||
"--models", | ||
nargs="*", | ||
type=Model, # type: ignore[arg-type] | ||
choices=Model, | ||
default=list(Model), | ||
help="Models to analyze. If none specified, analyzes all models.", | ||
) | ||
plot_group.add_argument( | ||
"--test-subset", | ||
type=TestSubset, | ||
default=TestSubset.uniq_protos, | ||
choices=list(TestSubset), | ||
help="Which subset of the WBM test set to use for evaluation. " | ||
"Default is to only use unique Aflow protostructures. " | ||
"Training sets like MPtrj, sAlex and Omat24 were filtered to remove protostructures" | ||
" overlap with WBM, resulting in a slightly more out-of-distribution test set.", | ||
) | ||
plot_group.add_argument( | ||
"--energy-type", | ||
type=str, | ||
default=Key.each, | ||
choices=[Key.e_form, Key.each], | ||
help="Whether to use formation energy or convex hull distance.", | ||
) | ||
plot_group.add_argument( | ||
"--show-non-compliant", | ||
action="store_true", | ||
help="Whether to show non-compliant models.", | ||
) | ||
plot_group.add_argument( | ||
"--use-full-rows", | ||
action="store_true", | ||
help="Whether to drop models that don't fit in complete rows.", | ||
) | ||
plot_group.add_argument( | ||
"--update-existing", | ||
action="store_true", | ||
help="Whether to update figures whose file paths already exist.", | ||
) | ||
cli_args, _ignore_unknown = cli_parser.parse_known_args() |
Oops, something went wrong.