GPlates / gplately

GPlately is a Python package to interrogate tectonic plate reconstructions.
https://gplates.github.io/gplately/
GNU General Public License v2.0
56 stars 13 forks source link

PTT: pkg_resources is deprecated as an API #200

Closed michaelchin closed 2 months ago

michaelchin commented 3 months ago

@jcannon-gplates @brmather

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?

https://github.com/GPlates/gplately/blob/5adebe5330a4a6a1a6da2b1b86b45aa565936eb9/gplately/ptt/documentation.py#L1-L23

jcannon-gplates commented 3 months ago

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.

michaelchin commented 3 months ago

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?

michaelchin commented 3 months ago

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?

michaelchin commented 3 months ago

actionable tasks:

  1. I will copy PTT examples to gplately/Notebooks/Example/ptt
  2. John will do a final PTT release and archive PTT repository
  3. discuss and decide how to deliver examples, notebooks and data files https://github.com/GPlates/gplately/discussions/202
michaelchin commented 3 months ago

task 1 is done in https://github.com/GPlates/gplately/commit/4237ca04e9791e774ff1e90b94e69eb74a6931ad

pending on task 2 and 3

jcannon-gplates commented 3 months ago

task 1 is done in https://github.com/GPlates/gplately/commit/4237ca04e9791e774ff1e90b94e69eb74a6931ad

Thanks for that. I've made comments on task 3 in your discussion #202

michaelchin commented 3 months ago

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.

michaelchin commented 2 months ago

task 1 is done in https://github.com/GPlates/gplately/commit/4237ca04e9791e774ff1e90b94e69eb74a6931ad

task 2 will be tracked in https://github.com/EarthByte/PlateTectonicTools/issues/8

task 3 will be tracked in #202

michaelchin commented 2 months ago

close this issue once #221 is approved and merged