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

Refactor the area loading internal function #451

Merged
merged 3 commits into from Aug 15, 2022

Conversation

mraspaud
Copy link
Member

@mraspaud mraspaud commented Aug 12, 2022

This PR adds the possibility to create an area definition from a yaml string. So create_area_def_from_dict and create_area_def_from_yaml utility functions were added.

This PR refactors the area loading a little.

@gerritholl
Copy link
Collaborator

How is this different from load_area_from_string?

@mraspaud
Copy link
Member Author

it probably isn't, I wasn't aware it existed :) I'll have a look

@mraspaud
Copy link
Member Author

Sorry about that @gerritholl , I was so sure this didn't exist already. Anyway, I removed the meat of this and just left the small refactoring.

@mraspaud mraspaud changed the title Refactor to add utility area creation functions Refactor the area loading internal function Aug 12, 2022
Comment on lines +1 to +3
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these lines actually do anything useful for a test module? As far as I know, the first line only matters for commandline scripts and the second is redundant in Python 3?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't thought about that tbh. For consistency, maybe we should have a PR just for removing all of these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or I could do it here...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably remove them. I've only ever added them for consistency. As a library, we could probably remove the usage of both in all pytroll packages.

Copy link
Collaborator

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just one minor question.

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@djhoese
Copy link
Member

djhoese commented Aug 14, 2022

Regarding the test failures:

This has to do with new versions of setuptools. I would think we should be fine, but obviously things aren't working. It looks like there has been a patch release of setuptools since the last CI run here. It may be worth restarting them @mraspaud but I wanted to see what you thought. I can't tell from the output what version of setuptools was used in the test install. Or I wonder if this requires a new version of versioneer.

@djhoese
Copy link
Member

djhoese commented Aug 14, 2022

Ah, there was a versioneer release to fix it: https://github.com/python-versioneer/python-versioneer/releases/tag/0.23

@mraspaud
Copy link
Member Author

Updated versioneer, let's see how it goes

@codecov
Copy link

codecov bot commented Aug 15, 2022

Codecov Report

Merging #451 (f44e616) into main (df76244) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #451   +/-   ##
=======================================
  Coverage   94.28%   94.28%           
=======================================
  Files          68       69    +1     
  Lines       12361    12369    +8     
=======================================
+ Hits        11654    11662    +8     
  Misses        707      707           
Flag Coverage Δ
unittests 94.28% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pyresample/test/test_utils.py 100.00% <ø> (ø)
pyresample/area_config.py 90.65% <100.00%> (+0.10%) ⬆️
pyresample/test/test_area_config.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 94.129% when pulling f44e616 on mraspaud:feature-area-def-from-yaml into df76244 on pytroll:main.

@mraspaud mraspaud merged commit 363167f into pytroll:main Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants