roocs / clisops

Climate Simulation Operations
https://clisops.readthedocs.io/en/latest/
Other
21 stars 9 forks source link

Use platformdirs #323

Closed Zeitsperre closed 6 months ago

Zeitsperre commented 6 months ago

Pull Request Checklist:

What kind of change does this PR introduce?:

Does this PR introduce a breaking change?:

Yes. The default location hard-set in the roocs.ini configuration has been removed.

Additionally, the .clisops_testing_data folder can be removed from your $HOME folder. This is now saved to $HOME/.cache/clisops on *nix.

Other information:

On Linux, this looks like:


from clisops.core.regrid import CONFIG

CONFIG["clisops:grid_weights"]["local_weights_dir"]
>>>'/home/my_user/.local/share/clisops/weights_dir'
coveralls commented 6 months ago

Pull Request Test Coverage Report for Build 7898546444

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
clisops/core/regrid.py 14 16 87.5%
clisops/utils/common.py 2 11 18.18%
<!-- Total: 18 29 62.07% -->
Files with Coverage Reduction New Missed Lines %
clisops/utils/common.py 1 68.63%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 7890990318: -0.2%
Covered Lines: 1777
Relevant Lines: 2452

💛 - Coveralls
cehbrecht commented 6 months ago

@Zeitsperre @sol1105 when using platformdirs could we skip the roocs.ini config for weights_dir?

Zeitsperre commented 6 months ago

@cehbrecht I suppose you technically could. I've set it up so that if the option is not provided, it'll use a cached location, but if you'd rather remove this option entirely, you should be able to work with locations provided uniquely by platformdirs.