-
Notifications
You must be signed in to change notification settings - Fork 36
docs: explain LAMMPS exploration extra files #393
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,8 @@ | |
|
|
||
| class TestMakeLmpTaskGroupFromConfig(unittest.TestCase): | ||
| def setUp(self): | ||
| self.extra_file = Path("SiC_ZBL.txt") | ||
| self.extra_file.write_text("ZBL table content\n") | ||
| self.config_npt = { | ||
| "type": "lmp-md", | ||
| "Ts": [100], | ||
|
|
@@ -51,13 +53,30 @@ def setUp(self): | |
|
|
||
| def tearDown(self): | ||
| os.remove(self.config_template["lmp_template_fname"]) | ||
| self.extra_file.unlink() | ||
|
|
||
| def test_npt(self): | ||
| tgroup = make_lmp_task_group_from_config( | ||
| self.numb_models, self.mass_map, self.config_npt | ||
| ) | ||
| self.assertTrue(isinstance(tgroup, NPTTaskGroup)) | ||
|
|
||
| def test_npt_copies_input_extra_files_to_each_task(self): | ||
| config = { | ||
| **self.config_npt, | ||
| "input_extra_files": [str(self.extra_file)], | ||
| } | ||
| tgroup = make_lmp_task_group_from_config( | ||
| self.numb_models, self.mass_map, config | ||
| ) | ||
| tgroup.set_conf(["LAMMPS configuration"]) | ||
| tgroup.make_task() | ||
|
|
||
| self.assertEqual( | ||
| tgroup[0].files()[self.extra_file.name], | ||
| "ZBL table content\n", | ||
| ) | ||
|
Comment on lines
+64
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This builds exactly one task, so the name
|
||
|
|
||
| def test_template(self): | ||
| tgroup = make_lmp_task_group_from_config( | ||
| self.numb_models, self.mass_map, self.config_template | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fixture path has no directory component, which makes the basename behaviour invisible to the test.
Because this is the bare name
SiC_ZBL.txt,Path(ii).nameandstr(ii)produce the identical string innpt_task_group.py, and replacing one with the other leaves all 5 tests passing. That is the specific property the new paragraph asserts ("available there by its basename") and the specific property the new example depends on -assets/dp/SiC_ZBL.txtis listed but referenced downstream asSiC_ZBL.txt.Writing the fixture into a subdirectory and passing
sub/SiC_ZBL.txtwould make the stripping observable.