This document describes the utility scripts in this directory.
The process_benchmarks.py script converts one or more JSON files created by pytest-benchmark into a single CSV file containing benchmark results. The script takes 2 positional arguments:
- The path to the directory containing the JSON files.
- The path to the directory to create the results CSV.
Input JSON files are expected to be named according to the pytest-benchmark format used when the --benchmark-autosave is provided:
<commitid>_<date>_<time>_<isdirty>.jsonFor instance, e689af57e7439b9005749d806248897ad550eab5_20150811_041632_uncommitted-changes.json.
Note: the process_benchmarks.py script depends on seaborn, which is not included as a dependency in either etc/environment.yml or in any of the optional groups in pyproject.toml, since this is the only place it is used in this repository.
The update_version.py script can be used to update FloPy version numbers. Running the script first updates the version in version.txt, then propagates the change to various other places version strings or timestamps are embedded in the repository:
flopy/version.pyCITATION.cffREADME.mddocs/PyPI_release.md
The script acquires a file lock before writing to files to make sure only one process edits the files at any given time and prevent desynchronization.
If the script is run with no arguments, the version number is not changed, but updated timestamps are written. In all cases the resulting version is printed to stdout. To set the version number, use the --version (short -v) option, e.g.:
python scripts/update_version.py -v 3.3.6Two flags derive the version instead of taking it explicitly:
--release(short-r) strips the development segment (e.g..dev0) from the current version, giving the version to release.--post-release(short-p) gives the development version for the next cycle: the next minor version, with a.devNsegment whereNis the patch number just released (e.g.3.10.0.dev2after3.9.2).
To print the version without writing any changes, add --dry-run:
python scripts/update_version.py --dry-runWith no other flag this simply returns the contents of version.txt.