A library to extract from CEPAC and STOP output files
Project description
Note: make sure that twine distribution is <= 6.0.1 to be compatible with pyproject.toml.
Note: out_data files need to be regenerated with the current library structure in place (i.e. the module, class, and function definitions). So the library needs to be created then used to generate new out_data files, before others can use it. (I have already done this for the current library structure, but if it changes, the out_data might need to be regenerated.) See Developer's Notes below.
Commands to build
Remember to update the version number in the pyproject.toml file, and delete any old distributions. The twine upload will not work if there's any old versions around.
py -m build
This should create a dist folder with a tar.gz and a wheel build.
Commands to upload to PyPi or TestPyPi
py -m twine upload --repository pypi dist/*
py -m twine upload --repository testpypi dist/*
Note you'll need to create a PyPi and/or TestPyPi account and an API access token, and provide the token to twine, either via the commandline or via a .pypirc file. PyPi and TestPyPi are separate: they will require separate accounts and separate access tokens.
If you choose to use a .pypirc file, an example is provided in this repo, but it needs to be placed in your local home directory, not the project directory!
Commands to install the package
In general, you can find the correct command easily on the package webpage:
The command should be something like:
-
Test PyPi:
pip install -i https://test.pypi.org/simple/ mpec-extract -
PyPi:
pip install mpec-extract
Developer's Notes
Generating .out_data files
This is what the error might look like for an out of date out_data file:
Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
ModuleNotFoundError: No module named 'm_cohorts'
You need to go to the MCT repo to recreate the out_data files. As of 8/20/25, the script is in a separate branch of the MCT repo, called extract_library. The script is called generate_data_file.py. That repo should already include the newer files, marked with "_new". Also, they should be in the MPEC Model Resources folder for now.
The reason the out_data files need to be regenerated is because when the out_data file is pickled, it will save references to the module and class whose data it is saving. The old files are saving references to m_cohorts.CohortData and m_cohorts.GenericMonth, which is not ok because the pickle file needs to be loaded via the import_data_file() function in the extract_backend package, which cannot access m_cohorts.py. The data file needs to be saved within the structure of the package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpec_extract-0.1.5.tar.gz.
File metadata
- Download URL: mpec_extract-0.1.5.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26adfddc6459efebaa2fe17275cd2b72b05e999486ea0447ca010b00d1c8b1c0
|
|
| MD5 |
c13b34f33539844585754cd62e66c847
|
|
| BLAKE2b-256 |
f2719baa47e0883d0c7768f24c08cb76e461626c4646512d8e25c99524c05184
|
File details
Details for the file mpec_extract-0.1.5-py3-none-any.whl.
File metadata
- Download URL: mpec_extract-0.1.5-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d8217a77ae55b8fc11bd704d56dd3c9448c207a3f9bfd02b7c9ef829f49153e
|
|
| MD5 |
bca7c68f7dff2caddefb84c4339e8462
|
|
| BLAKE2b-256 |
609c1327e7d290f09978a508e4c1c266bd27898a2fc0c4d7c8b23c59f8dd5a08
|