Skip to content
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

revise configuration handling #305

Merged
merged 32 commits into from
May 15, 2024
Merged

revise configuration handling #305

merged 32 commits into from
May 15, 2024

Conversation

johntruckenbrodt
Copy link
Owner

@johntruckenbrodt johntruckenbrodt commented Apr 24, 2024

This is a long due revision of the configuration handling. Now, pyroSAR's configuration integrates much better with that of SNAP and a user can directly modify SNAP configuration via pyroSAR.
All changes in a nutshell:

  • renamed _dev_config.py to config.py
  • centralized variable __LOCAL__ (in drivers.py and config.py) into config.py
  • config.py: removed class Storage and its uses
  • new class examine.SnapProperties for reading and modifying SNAP configuration
  • class examine.ExamineSnap:
    • remove auxdata from identifiers and don't set it as attribute
    • remove config section OUTPUT
    • do not set attributes auxdatapath, properties
    • remove method __update_snap_properties and instead use new SnapProperties class to set attribute snap_properties
    • add new modifiable properties auxdatapath and userpath

Example to modify the SNAP user directory to change the location where SNAP stores any data during processing:

from pyroSAR.examine import ExamineSnap
config = ExamineSnap()
config.userpath = '/path/to/snap/data'

This will add an entry snap.userdir = /path/to/snap/data in $HOME/.snap/etc/snap.properties, which will then be read by SNAP and relevant pyroSAR functions like e.g. auxdata.dem_autoload.

@coveralls
Copy link

coveralls commented May 6, 2024

Pull Request Test Coverage Report for Build 9093547722

Details

  • 173 of 201 (86.07%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.4%) to 52.264%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyroSAR/config.py 1 2 50.0%
pyroSAR/examine.py 137 164 83.54%
Files with Coverage Reduction New Missed Lines %
pyroSAR/examine.py 1 79.33%
Totals Coverage Status
Change from base Build 9079306250: 0.4%
Covered Lines: 3648
Relevant Lines: 6980

💛 - Coveralls

@johntruckenbrodt johntruckenbrodt merged commit 54c7d39 into main May 15, 2024
4 checks passed
@johntruckenbrodt johntruckenbrodt deleted the feature/config branch May 15, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants