pytroll / pygac

A python package to read and calibrate NOAA and Metop AVHRR GAC and LAC data
https://pygac.readthedocs.org/
GNU General Public License v3.0
20 stars 25 forks source link

Allow PathLike objects #92

Closed carloshorn closed 3 years ago

carloshorn commented 3 years ago

This PR allows pygac to open PathLike objects, that provide an open method. This is motivated by the new satpy feature from https://github.com/pytroll/satpy/pull/1439 and the subsequent PR https://github.com/pytroll/satpy/pull/1470, where @sfinkens asked to move the implementation to pygac.

ghost commented 3 years ago

Congratulations :tada:. DeepCode analyzed your code in 6.66 seconds and we found no issues. Enjoy a moment of no bugs :sunny:.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

carloshorn commented 3 years ago

Hi @sfinkens, @mraspaud,

It appears to me like @stickler-ci does only know python 2 syntax, because it does not know the exception FileNotFoundError. Reading the deepcode-ci-bot comments, I will refactor the file_opener method, so please wait with the reviews.

Another thing related to this PR, would you mind, if we stop supporting python 2 and update @stickler-ci to check for python 3 syntax?

mraspaud commented 3 years ago

Yes, please do update .stickler.yaml for python 3. You can check in the satpy repo how it's done: https://github.com/pytroll/satpy/blob/master/.stickler.yml

sfinkens commented 3 years ago

I'd be ok with dropping Python 2 support

carloshorn commented 3 years ago

I'd be ok with dropping Python 2 support

Great, I would propose to align with satpy and set the required python version to >=3.6

mraspaud commented 3 years ago

I'd be ok with dropping Python 2 support

Great, I would propose to align with satpy and set the required python version to >=3.6

Go ahead :+1:

codecov[bot] commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@2962a86). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #92   +/-   ##
=========================================
  Coverage          ?   66.30%           
=========================================
  Files             ?       34           
  Lines             ?     2858           
  Branches          ?        0           
=========================================
  Hits              ?     1895           
  Misses            ?      963           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2962a86...166cbbd. Read the comment docs.

carloshorn commented 3 years ago

To satisfy codebeat, I guess we will need a huge refactor of the Reader class and its subclasses, but this is beyond the scope of this PR.