Quickstart
Step 1: Install the data package in your DISPATCHES environment using pip
conda activate dispatches-dev # or the name of your DISPATCHES dev environment
pip install git+https://github.com/gmlc-dispatches/dynamic-sweep-data
Step 2: Access the contents of the data package in your code using dispatches_data.api
Using dispatches_data.api.path():
from dispatches_data.api import path
# path_to_data_package is a standard pathlib.Path object
path_to_data_package = path("dynamic_sweep")
# subdirectories and files can be accessed using the pathlib.Path API
path_to_NE_results = path_to_data_package / "NE" / "sweep_parameters_results_NE_whole.h5"
assert path_to_NE_results.is_file()
# if the path must be passed to a function that only accepts `str` objects, it can be converted using `str()`
path_to_NE_results_as_str = str(path_to_NE_results)
Using dispatches_data.api.files():
from dispatches_data.api import files
# paths_to_all_results_files will be a list of pathlib.Path objects for each file matching the specified `pattern`
paths_to_all_results_files = files("dynamic_sweep", pattern="**/sweep_parameters_results_*_whole.h5")
# check that the list of found files is not empty
assert paths_to_all_results_files
# `dispatches_data.api.files()` always returns a list, even if only one file matches
path_to_NE_results = files("dynamic_sweep", pattern="NE/*result_*_whole.h5")[0]
Examples
Loading multiple CSV files into a pandas DataFrame
import pandas as pd
from dispatches_data.api import files
def load_data(case_study: str = "NE") -> pd.DataFrame:
results_file_pattern = f"{case_study}/results_*_sweep_*/*.csv"
csv_files_to_load = files("dynamic_sweep", pattern=results_files_pattern)
if not csv_files_to_load:
raise LookupError("No files found with pattern {results_file_pattern!r}")
df = pd.concat(
[pd.read_csv(csv_path) for csv_path in csv_files_to_load],
axis="index"
)
# process df as needed
return df
def main():
df_NE = load_data("NE")
df_RE = load_data("RE")
...
Metadata
Release files for dispatches-dynamic-sweep-data 23.7.24
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dispatches-dynamic-sweep-data-23.7.24.tar.gz | 72.5 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dispatches_dynamic_sweep_data-23.7.24-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 148.5 MB
Release files / dispatches-dynamic-sweep-data-23.7.24.tar.gz
| Download URL | dispatches-dynamic-sweep-data-23.7.24.tar.gz |
|---|---|
| Size | 72.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
132376b07b8c61434c9aca60cf38f2328b3a4a9fca61dfa5dcbd1b2077a2423f
|
|
BLAKE2b-256 checksum How to use checksums |
5f18fcb1edde3dbbfa4ba1ab4b1743c6ecc6b3768ad5e009003ac470d8340162
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / dispatches_dynamic_sweep_data-23.7.24-py3-none-any.whl
| Download URL | dispatches_dynamic_sweep_data-23.7.24-py3-none-any.whl |
|---|---|
| Size | 76.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ac040c75a6b2f6ddf74d5d292f4e7668e86e8c8a68702b4193eaa2855c12039
|
|
BLAKE2b-256 checksum How to use checksums |
e16a46feee15a151e5386239aab5d80764fb8b8a5c2861fecabba63b10dcd7d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for dispatches-dynamic-sweep-data 23.7.24
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.