SETI / rms-pdsfile

pdsfile Python module
Apache License 2.0
0 stars 0 forks source link

Fixed issue 26 and OPUS import error #27

Closed juzen2003 closed 7 months ago

juzen2003 commented 7 months ago

Updates:

  1. Fixed #26 by removing pdsfile/general_helper.py, all the helper functions (including checking for PDS_HOLDINGS_DIR and PDS4_HOLDINGS_DIR env variables) for pytest are moved back to their corresponding helper files under tests or rules for pds3 & pds4.
    • Test method:
      • Remove PDS_HOLDINGS_DIR and PDS4_HOLDINGS_DIR from your env variables, and restart terminal
      • import pdsfile, you won't see any error, and you can instantiate pdsfile instance and call functions or properties as usual.
      • Put back PDS_HOLDINGS_DIR and PDS4_HOLDINGS_DIR and restart terminal, run ./run_tests_coverage.sh and all tests will pass
  2. Fixed the OPUS import error caused by missing opus id when pds3 file are instantiate from from_filespec.
    • Test Method for OPUS import (for reference, not related to this repo):
      • Make sure local rms-pdsfile is at this branch
      • Run test opus import ./import_for_tests.sh using this branch https://github.com/SETI/rms-opus/pull/1338/files , and import will run without errors.
      • Change line 216 at apps/tools/file_utils.py to viewset = pdsfile.pdsviewable.PdsViewSet.from_dict(preview_json) and OPUS will run fine locally
      • run ./run_coverage.sh or python manage.py test -b, and everything will pass
codecov[bot] commented 7 months ago

Codecov Report

Attention: 102 lines in your changes are missing coverage. Please review.

Comparison is base (f383168) 78.21% compared to head (643b6d4) 77.21%.

Files Patch % Lines
pdsfile/pds4file/rules/pytest_support.py 3.94% 73 Missing :warning:
pdsfile/pds3file/rules/pytest_support.py 62.33% 26 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #27 +/- ## ========================================== - Coverage 78.21% 77.21% -1.01% ========================================== Files 40 39 -1 Lines 5742 5788 +46 Branches 1386 1409 +23 ========================================== - Hits 4491 4469 -22 - Misses 1031 1098 +67 - Partials 220 221 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.