PTT: pkg_resources is deprecated as an API
Closed this issue · 9 comments
See the code below. The pkg_resources is deprecated as an API.
Do we still need this install_documentation() function?
The PTT examples are not in gplately repository. Should we copy them into the ptt folder?
If the PTT is already a part of gplately, should we archive the PTT repository https://github.com/EarthByte/PlateTectonicTools?
gplately/gplately/ptt/documentation.py
Lines 1 to 23 in 5adebe5
The PTT examples are not in gplately repository. Should we copy them into the ptt folder?
I guess we might as well. Looks like they're all notebooks, so could just simply copy to them to a new ptt
sub-directory of gplately/Notebooks/Example/ (which could just contain the PTT 'data' and 'notebooks' directories)?
Do we still need this install_documentation() function?
I'm guessing not, since you don't install the gplately examples, AFAIK, so ptt probably doesn't need it either.
However, if we do keep it then I guess could replace pkg_resources
with importlib.resources (added in Python 3.7).
If the PTT is already a part of gplately, should we archive the PTT repository?
Yes definitely, I should've done that before actually.
Someone recently brought that to my attention, and I decided I should first do one final PTT release (when pyGPlates is released, soon) just to bring PTT up-to-date with what it was when it got copied into GPlately. Currently the latest PTT, which is 0.4.1, is a fair bit behind that - mostly the continent contouring - and so conda and pip versions of PTT are missing that. There are some workflows (like optAPM) that require the latest dev version of PTT (ie, don't work with PTT 0.4.1). I suppose it's not really necessary - could just switch them to use GPlately instead - but might be easier to just do one final PTT release.
We can discuss in-person at the next meeting.
The PTT examples are not in gplately repository. Should we copy them into the ptt folder?
I guess we might as well. Looks like they're all notebooks, so could just simply copy to them to a new
ptt
sub-directory of gplately/Notebooks/Example/ (which could just contain the PTT 'data' and 'notebooks' directories)?Do we still need this install_documentation() function?
I'm guessing not, since you don't install the gplately examples, AFAIK, so ptt probably doesn't need it either.
However, if we do keep it then I guess could replace
pkg_resources
with importlib.resources (added in Python 3.7).If the PTT is already a part of gplately, should we archive the PTT repository?
Yes definitely, I should've done that before actually.
Someone recently brought that to my attention, and I decided I should first do one final PTT release (when pyGPlates is released, soon) just to bring PTT up-to-date with what it was when it got copied into GPlately. Currently the latest PTT, which is 0.4.1, is a fair bit behind that - mostly the continent contouring - and so conda and pip versions of PTT are missing that. There are some workflows (like optAPM) that require the latest dev version of PTT (ie, don't work with PTT 0.4.1). I suppose it's not really necessary - could just switch them to use GPlately instead - but might be easier to just do one final PTT release.
We can discuss in-person at the next meeting.
Currently the gplately notebooks are excluded from the package. The reason is that the notebooks and associated data files are large. And users may have trouble in finding them. For example, in my computer, they are at ~/micromamba/envs/gplately/lib/python3.11/site-packages/gplately/notebooks. I can find them, but I guess other people might find it easier to just download them from somewhere.
I think we should create a topic in github Discussion to decide if the notebooks should be included and where to put them.
By the way, my memory failed me again. Could you remind me what was the reason to put PTT inside GPlately?
Now I see that install_documentation() was designed to copy notebooks from ~/micromamba/envs/gplately/lib/python3.11/site-packages/ptt/notebooks to a user specified folder.
Can we just grab the notebooks and data from Internet, instead of installing them in users' site-packages folder by default?
actionable tasks:
- I will copy PTT examples to gplately/Notebooks/Example/ptt
- John will do a final PTT release and archive PTT repository
- discuss and decide how to deliver examples, notebooks and data files #202
task 1 is done in 4237ca0
pending on task 2 and 3
Per discuss #202, I think we should delete https://github.com/GPlates/gplately/blob/master/gplately/ptt/documentation.py.
@GPlates/gplately-dev
I will delete https://github.com/GPlates/gplately/blob/master/gplately/ptt/documentation.py in 7 days if there is no objection.
task 1 is done in 4237ca0
task 2 will be tracked in EarthByte/PlateTectonicTools#8
task 3 will be tracked in #202
close this issue once #221 is approved and merged