-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17bb201
commit a490e43
Showing
4 changed files
with
69 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
import warnings | ||
|
||
# Locate the LICENSE file | ||
license_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "LICENSE") | ||
|
||
if os.path.exists(license_path): | ||
try: | ||
with open(license_path, "r") as license_file: | ||
license_content = license_file.read() | ||
warnings.warn( | ||
f"LICENSE content:\n{license_content}", | ||
category=UserWarning | ||
) | ||
except Exception as e: | ||
pass |
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,25 @@ | ||
import pytest | ||
from mlip_arena.models import MLIPEnum | ||
from mlip_arena.tasks.mof.flow import widom_insertion | ||
from mlip_arena.tasks.mof.input import get_atoms_from_db | ||
from prefect.testing.utilities import prefect_test_harness | ||
|
||
from ase.build import molecule | ||
|
||
|
||
@pytest.mark.parametrize("model", [MLIPEnum["MACE-MP(M)"]]) | ||
def test_widom_insertion(model: MLIPEnum): | ||
atoms = get_atoms_from_db("mof.db") | ||
with prefect_test_harness(): | ||
result = widom_insertion.with_options( | ||
refresh_cache=True, | ||
)( | ||
structure=atoms, | ||
gas=molecule("CO2"), | ||
calculator_name=model.name, | ||
num_insertions=10, | ||
) | ||
assert isinstance(result, dict) | ||
assert isinstance(result["henry_coefficient"][0], float) | ||
assert isinstance(result["averaged_interaction_energy"][0], float) | ||
assert isinstance(result["heat_of_adsorption"][0], float) |