Skip to content

Commit

Permalink
Merge pull request #290 from materialsproject/update
Browse files Browse the repository at this point in the history
Update dependencies, clean up
  • Loading branch information
mattmcdermott authored Sep 10, 2024
2 parents 3c06dbd + f723c45 commit 8aff456
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 4,298 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: ruff
run: |
ruff --version
ruff check
ruff check .
- name: mypy
run: |
Expand Down
7 changes: 2 additions & 5 deletions examples/1_enumerators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,14 @@
"metadata": {},
"outputs": [],
"source": [
"import logging\n",
"from pprint import pprint\n",
"\n",
"from mp_api.client import MPRester\n",
"from pymatgen.core.periodic_table import Element\n",
"\n",
"from rxn_network.core import Composition\n",
"from rxn_network.costs.functions import Softplus\n",
"from rxn_network.entries.entry_set import GibbsEntrySet\n",
"from rxn_network.enumerators.basic import BasicEnumerator, BasicOpenEnumerator\n",
"from rxn_network.enumerators.minimize import MinimizeGibbsEnumerator, MinimizeGrandPotentialEnumerator\n",
"from rxn_network.entries.entry_set import GibbsEntrySet\n",
"from rxn_network.reactions.reaction_set import ReactionSet\n",
"\n",
"# this is useful if you are editing your code locally!\n",
"%load_ext autoreload\n",
Expand Down Expand Up @@ -1564,6 +1560,7 @@
"outputs": [],
"source": [
"from jobflow.managers.local import run_locally\n",
"\n",
"from rxn_network.jobs.core import ReactionEnumerationMaker"
]
},
Expand Down
27 changes: 13 additions & 14 deletions examples/2_networks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,19 @@
"metadata": {},
"outputs": [],
"source": [
"import logging \n",
"\n",
"from mp_api.client import MPRester\n",
"\n",
"from rxn_network.costs.functions import Softplus\n",
"from rxn_network.entries.entry_set import GibbsEntrySet\n",
"from rxn_network.enumerators.basic import BasicEnumerator, BasicOpenEnumerator\n",
"from rxn_network.enumerators.minimize import MinimizeGibbsEnumerator, MinimizeGrandPotentialEnumerator\n",
"from rxn_network.network.visualize import plot_network\n",
"from rxn_network.enumerators.basic import BasicEnumerator\n",
"from rxn_network.network.network import ReactionNetwork\n",
"from rxn_network.network.visualize import plot_network\n",
"from rxn_network.pathways.solver import PathwaySolver\n",
"from rxn_network.reactions.computed import ComputedReaction\n",
"\n",
"# this is useful if you are editing the rxn_network package locally!\n",
"%load_ext autoreload \n",
"%load_ext autoreload\n",
"%autoreload 2"
]
},
Expand Down Expand Up @@ -710,7 +708,7 @@
"product_entries = []\n",
"for i in [\"YMnO3\",\"LiCl\",\"CO2\"]:\n",
" product_entries.append(rn.entries.get_min_entry_by_formula(i))\n",
" \n",
"\n",
"net_rxn = ComputedReaction.balance(rn.precursors, product_entries)\n",
"net_rxn"
]
Expand Down Expand Up @@ -796,8 +794,8 @@
}
],
"source": [
"balanced_paths = ps.solve(net_rxn, max_num_combos=4, \n",
" intermediate_rxn_energy_cutoff=0.0, \n",
"balanced_paths = ps.solve(net_rxn, max_num_combos=4,\n",
" intermediate_rxn_energy_cutoff=0.0,\n",
" use_minimize_enumerator=False,\n",
" filter_interdependent=True)"
]
Expand Down Expand Up @@ -923,9 +921,10 @@
"metadata": {},
"outputs": [],
"source": [
"from jobflow.managers.local import run_locally\n",
"\n",
"from rxn_network.flows.core import NetworkFlowMaker\n",
"from rxn_network.jobs.core import NetworkMaker, PathwaySolverMaker\n",
"from jobflow.managers.local import run_locally"
"from rxn_network.jobs.core import NetworkMaker, PathwaySolverMaker"
]
},
{
Expand All @@ -951,10 +950,10 @@
"metadata": {},
"outputs": [],
"source": [
"flow = NetworkFlowMaker(network_maker=network_maker, \n",
" solver_maker=solver_maker, \n",
" use_minimize_enumerators=False).make(precursors=precursors, \n",
" targets=targets, \n",
"flow = NetworkFlowMaker(network_maker=network_maker,\n",
" solver_maker=solver_maker,\n",
" use_minimize_enumerators=False).make(precursors=precursors,\n",
" targets=targets,\n",
" entries=filtered_entries)"
]
},
Expand Down
Loading

0 comments on commit 8aff456

Please sign in to comment.