ioos / ioos_metrics

Working on creating metrics for the IOOS by the numbers
https://ioos.github.io/ioos_metrics/
MIT License
2 stars 4 forks source link

Pkg metrics #64

Closed ocefpaf closed 2 months ago

ocefpaf commented 2 months ago

Wait for #57 to merge this one.

ocefpaf commented 2 months ago

@MathewBiddle this one is ready for review. The PyPI failure is b/c we don't have a tag yet.

MathewBiddle commented 2 months ago

something to investigate later, it takes a while to import ioos_metrics.ioos_metrics. On the order of a few seconds... Might be something of concern.

Otherwise this looks good to me.

ocefpaf commented 2 months ago

something to investigate later, it takes a while to import ioos_metrics.ioos_metrics. On the order of a few seconds... Might be something of concern.

Otherwise this looks good to me.

Did you install it or did you try to import from the root directory? The the former than there may be a problem with your setup and/or Windows. If the latter than it is expected at the first time b/c Python will travese all the function definitions and create the pyc files. The second time you import it will be much faster, even in a new session. This is what I get when installing it with pip install -e . --no-deps --force-reinstall to force everything to rebuild:


ipython                                           
Python 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:38:13) [GCC 12.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.22.2 -- An enhanced Interactive Python. Type '?' for help.

In [1]: %time import ioos_metrics.ioos_metrics
CPU times: user 1.52 s, sys: 56 ms, total: 1.57 s
Wall time: 485 ms

483 ms is not bad for a library with so many different dependencies.

MathewBiddle commented 2 months ago

Did you install it or did you try to import from the root directory?

import from the root directory.

the former than there may be a problem with your setup and/or Windows.

Agreed. At some point I'd like to reinstall the entire library. At some point...

ocefpaf commented 2 months ago

Agreed. At some point I'd like to reinstall the entire library. At some point...

We can tag a version and upload it to PyPI+conda-forge now. Then installing it will be conda install ioos_metrics from any environment. That will help a lot to run this, and the glider metrics, on Google colab.

MathewBiddle commented 2 months ago

Shall we tag a version? If so, what's the semantic versioning structure we should start with? 0.0.1 ?

MathewBiddle commented 2 months ago

I went with v0.0.1-alpha 😄

https://github.com/ioos/ioos_metrics/releases

ocefpaf commented 2 months ago

I went with v0.0.1-alpha 😄

Do you mind renaming that tag v0.1.0a0, or maybe just 0.1.0. That scheme is PEP440 compliant and will be accepted by PyPI and conda-forge. Also, I added manually a 0.1.0 dev0 to help Kathy out with the glider, before you merged this one, so we need to be higher than a 0.1.0.dev0.

MathewBiddle commented 2 months ago

Can I just rename the release?

MathewBiddle commented 2 months ago

how about https://github.com/ioos/ioos_metrics/releases/tag/v0.1.0a0

ocefpaf commented 2 months ago

Can I just rename the release?

You can edit it and issue a new tag. Or, if it is easier, delete both the release and tag and mint new ones.