Skip to main content

PyPI version PyPI pyversions Code style

Introduction to PyCollisionDB

PyCollisionDB is a Python package for interacting with the CollisionDB database of plasma collisional cross sections and rate coefficients.

Datasets in these collisional databases can be retrieved in a standardized way and compared, aggregated, and assessed using a set of predefined Python methods.

Installation

The PyCollisionDB package can be installed either from PYPI using pip

python3 -m pip install pycollisiondb

or from the source by running (one of the two) from the project source directory.

# either
python setup.py install

# or
python3 -m pip install .

PyCollision

The PyCollision object represents the main instance of the PyCollisionDB package for interacting with collisional databases, and datasets may be compared, output in various formats, and manipulated using the methods object as described below:

>>> from pycollisiondb.pycollisiondb import PyCollision

Convert Units

The PyCollision method convert_units can be used to change the units of datasets.

>>> pycoll.datasets[102737].x
array([  1000.,   4000.,   9000.,  16000.,  25000.,  36000.,  49000.,
     64000.,  81000., 100000.])
>>> # The units of all datasets are changed,
>>> # Energy is changed from eV.u-1 (default) to keV.u-1 and sigma from cm2 (default) to a02 (atomic units).
>>> # This accesses the pyqn library.
 >>> pycoll.convert_units({'E': 'keV.u-1', 'sigma': 'a02'})
 >>> pycoll.datasets[102737].x
 array([  1.,   4.,   9.,  16.,  25.,  36.,  49.,  64.,  81., 100.])
>>> # Change the units of a single dataset,
>>> # provide the column name followed by units as arguments.
>>> pycoll.datasets[102737].convert_units('sigma', 'm2')

Visualization tools

The PyCollision method plot_all_datasets can be used to create plots using the pyplot submodule of the Matplotlib library as the visualization utility.

>>> import matplotlib.pyplot as plt
>>> %matplotlib notebook
>>> # Make a plot, indicating how the data should be labelled.
>>> fig, ax = plt.subplots()
>>> # The default legend consists of qid/pk and reaction labels,
>>> # it can be customized to include refs and process_types or either of these lables.
>>> pycoll.plot_all_datasets(ax, label=('reaction', 'qid', 'refs', 'process_types'))
>>> plt.legend()
figure

Metadata

Release files for pycollisiondb 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycollisiondb 0.1.6
File Size Uploaded Provenance
pycollisiondb-0.1.6.tar.gz 19.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pycollisiondb 0.1.6
File Interpreter ABI Platform
pycollisiondb-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 34.5 kB

Release files / pycollisiondb-0.1.6.tar.gz

Download URL pycollisiondb-0.1.6.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
74218ead85a8421bd37de509127f4891bbd343000065f543a0a79bd6760f5ecc
BLAKE2b-256 checksum
How to use checksums
cb05e2477bed521205306af76177c9359e3fb62b1dedc8692de7838f302223b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / pycollisiondb-0.1.6-py3-none-any.whl

Download URL pycollisiondb-0.1.6-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d7389897a921236143dd26d3c0331b3cec6b8b325e4e56d69c12d88e7cf11ae
BLAKE2b-256 checksum
How to use checksums
ba9baffa5aa5b3cdd7c9e23d6d8caa7e7a1a99be188dadba1cb89075a519501f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Security for pycollisiondb 0.1.6

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page