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

data/wbm/compile_wbm_test_set.py: various errors #121

Closed
pbenner opened this issue Aug 5, 2024 · 2 comments
Closed

data/wbm/compile_wbm_test_set.py: various errors #121

pbenner opened this issue Aug 5, 2024 · 2 comments
Labels
bug Something isn't working data Data loading and processing reproducibility Issues or improvements to reproducibility

Comments

@pbenner
Copy link
Collaborator

pbenner commented Aug 5, 2024

I've attached a patch that fixes most issues for me. However, two asserts fail:

assert n_corrected == 100_930, f"{n_corrected=} expected 100,930"
assert df_summary.e_correction_per_atom_mp2020.mean().round(4) == -0.1069

Also I get:

Traceback (most recent call last):
  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/pymatgen/analysis/phase_diagram.py", line 1776, in get_decomposition
    pd = self.get_pd_for_entry(comp)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/pymatgen/analysis/phase_diagram.py", line 1763, in get_pd_for_entry
    raise ValueError(f"No suitable PhaseDiagrams found for {entry}.")
ValueError: No suitable PhaseDiagrams found for Ac6 U2.

And:

  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/pymatgen/analysis/phase_diagram.py", line 1782, in get_decomposition
    return _get_slsqp_decomp(comp, competing_entries)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/pymatgen/analysis/phase_diagram.py", line 2088, in _get_slsqp_decomp
    Es = np.array([comp_entry.energy_per_atom for comp_entry in competing_entries])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/pymatgen/analysis/phase_diagram.py", line 2088, in <listcomp>
    Es = np.array([comp_entry.energy_per_atom for comp_entry in competing_entries])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/pymatgen/entries/__init__.py", line 87, in energy_per_atom
    return self.energy / self.composition.num_atoms
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pbenner/.local/opt/anaconda3/envs/mace/lib/python3.11/site-packages/pymatgen/core/composition.py", line 497, in num_atoms
    return self._n_atoms
           ^^^^^^^^^^^^^
AttributeError: 'Composition' object has no attribute '_n_atoms'. Did you mean: '_natoms'?
> pip list | grep pymatgen
pymatgen                  2024.7.18
@janosh janosh changed the title data/wbm/compile_wbm_test_set.py: various errors data/wbm/compile_wbm_test_set.py: various errors Aug 5, 2024
@janosh
Copy link
Owner

janosh commented Aug 5, 2024

thanks for reporting @pbenner. that script is surprisingly high-entropy, stuff keeps breaking. that _n_atoms error in particular is strange. i'll rerun your patch in a bit to see which errors i can reproduce.

janosh added a commit that referenced this issue Aug 7, 2024
…share

also closes `data/wbm/compile_wbm_test_set.py`: various errors #121
@janosh
Copy link
Owner

janosh commented Aug 7, 2024

@pbenner have a look at 20c752a and a2d7add in #122. those should fix both PatchedPhaseDiagram errors you encountered.

re the formerly 100,930 WBM computed entries of which only 99k now receive MP2020 corrections, I added this comment which might explain the discrepancy but i'm not sure. maybe @mkhorton can comment if there could be any edge cases where strict_anions="no_check" wouldn't result in the previous MP2020 behavior materialsproject/pymatgen#3803

# TODO 2024-08-07 n_corrected used to be 100,930, may have changed as a result of the
# new strict_anions kwarg added in https://github.com/materialsproject/pymatgen/pull/3803
# but strict_anions="no_check" which is meant to restore the pre-3803 behavior now
# results in 99_000 corrected entries, which is closest one to the old number compared
# to the other strict_anions options "require_exact" and "require_bound"
assert n_corrected == 99_000, f"{n_corrected=:,} expected 100,930"
df_summary["e_correction_per_atom_mp2020"] = [

@janosh janosh closed this as completed in 8258c5c Aug 7, 2024
@janosh janosh added bug Something isn't working data Data loading and processing reproducibility Issues or improvements to reproducibility labels Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working data Data loading and processing reproducibility Issues or improvements to reproducibility
Projects
None yet
Development

No branches or pull requests

2 participants