Closed iProzd closed 3 months ago
Comparing iProzd:fix_mix_convert
(29bcf6a) with devel
(4bb4069)
✅ 2
untouched benchmarks
Attention: Patch coverage is 50.00000%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 84.30%. Comparing base (
4bb4069
) to head (c58a87f
).:exclamation: Current head c58a87f differs from pull request most recent head 29bcf6a
Please upload reports for the commit 29bcf6a to get more accurate results.
Files | Patch % | Lines |
---|---|---|
dpdata/deepmd/mixed.py | 50.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
tests/test_deepmd_mixed.py (3)
`334-336`: Proper cleanup in `tearDown` method. --- `317-337`: The structure of `TestMixedSingleSystemsDump` is well-organized for testing single system dumps. --- `318-333`: Ensure the test dump operation in `setUp` is intended for setup only and not an actual test.Verification successful
--- The test dump operation in `setUp` is only referenced within the `setUp` and `tearDown` methods, confirming it is intended for setup purposes only and not an actual test. - `tests/test_deepmd_mixed.py`: - Line 318: `self.system_1.to("deepmd/npy/mixed", "tmp.deepmd.mixed.single")` - Line 333: `if os.path.exists("tmp.deepmd.mixed.single"):` - Line 334: `shutil.rmtree("tmp.deepmd.mixed.single")`Scripts executed
The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Description: Verify if the test dump operation in `setUp` is used elsewhere or if it should be part of a test method. # Test: Search for references to `tmp.deepmd.mixed.single`. Expect: No references outside of `setUp` and `tearDown`. rg --type python $'tmp.deepmd.mixed.single' ``` Length of output: 73 --- --- Script: ```shell #!/bin/bash # Description: Verify if the test dump operation in `setUp` is used elsewhere or if it should be part of a test method. # Test: Search for references to `tmp.deepmd.mixed.single`. Expect: No references outside of `setUp` and `tearDown`. rg 'tmp.deepmd.mixed.single' --glob '*.py' ``` Length of output: 302
Use deepcopy when dumping mixed types in system level. Fix #670 .
Typically, users use the following command to dump list of systems to mixed_type:
This command will rebuild a new system with a new data dict, thus it does not change the original
system.data
.In #670 , when users use
on a system in standard format, it would directly convert the original
system.data
into mixed types, thus the originalsystem.data
would be changed.Use deepcopy to prevent this.
Summary by CodeRabbit
Bug Fixes
Tests