TDAmeritrade / stumpy

STUMPY is a powerful and scalable Python library for modern time series analysis

Home Page:https://stumpy.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add additional checks to `min.py`

seanlaw opened this issue · comments

Currently, min.py finds and returns the minimum python, numba, numpy, and scipy versions that are compatible with the minimum supported python (i.e., NOT end-of-life). This is super handy but we can/should take this a step further and also have this script check the necessary files (i.e., pyproject.toml, requirements.txt, environment.yml, .github/worflows/github-actions.yml, and README.md) to detect whether those files have mismatches or need to be updated as well.

Note that we don't necessarily want to change these files by default but, instead, be able to first CHECK and notify the user of all of the mismatches. Then possibly add an argparse flag like -force or something that will automatically make the changes to those files.

commented

@seanlaw I can take a crack at this one!

To clarify the request - the way I see it is as follows (please let me know if not the case)...

  • min.py should check all relevant files for minimum versions of python, numba, numpy and scipy
  • The relevant files are pyproject.toml, requirements.txt, environment.yml, .github/workflows/github-actions.yml and README.md
  • After min.py checks it should only notify the user if they require an updated version of any of the above packages across the above files - not updating those files to reflect the required version (for example if numba has an incorrectly listed version on requirements.txt then min.py would only notify the user this is the case - not updating requirements.txt)
  • Then argparse would allow the user to explicitly force an update to those files?

@joehiggi1758 That sounds about right. Once the minimum supported python, numba, numpy, and scipy versions are determined by min.py (this is super fast), then, by default, also print all of the files (and line numbers like grep -n?? ) where we will need to also update this the version numbers.

For now, let's ignore the -force part and only focus on identifying the places where we would need to update files. I think that will get us pretty far (and may possibly be sufficient).

commented

Sounds great - I'm on it!

commented

@seanlaw hey Sean - hope you're having a wonderful day!

QQ - do I need to create a unit test for min.py when I make this contribution?

I'm about 95% done writing the new function and will likely create a PR by mid-week!

@joehiggi1758 Good question! No, you do not need to write a unit test as this script is mostly for us developers. Additionally, it's code coverage is omitted from the coverage reporting along with other accessory helper scripts that we employ that are never seen by STUMPY users