Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpec_extract-0.1.6.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpec_extract-0.1.6-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file mpec_extract-0.1.6.tar.gz.

File metadata

  • Download URL: mpec_extract-0.1.6.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for mpec_extract-0.1.6.tar.gz
Algorithm Hash digest
SHA256 4833029e445e9f14a0b9399c1474fced18a4e98d54353626c2ee29b4e66ca131
MD5 b40d612799c35815ee3a81f3f5c5a0b3
BLAKE2b-256 4fd9f0f605546f7e01a6ff614032b0362bbedc2a053c43adcf6be2311f97f632

See more details on using hashes here.

File details

Details for the file mpec_extract-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: mpec_extract-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for mpec_extract-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4b7158bcdef3bb5f0bc645d588e20e411a20b5f4a94522b3cc524ffa40cba44a
MD5 aa910be568ac0fef10f27a0af3c69cce
BLAKE2b-256 ea8f8ad5df2044d96429b8366078e062935aaff28e6628fe01eb8a5b4d5b75e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page