Skip to main content

A package containing file readers for transmission spectrophotometry raw files.

Project description

fairmat-readers-transmission

A package developed by FAIRmat and collaborators that contains file readers for various transmission spectrophotometry file formats.

Install and use

To use the readers, install the package using pip and import the read_file function. It will check the file extension and, using an appropriate file reader, return a Python dictionary containing the data.

pip install fairmat-readers-transmission
from fairmat_readers_transmission import read_file

file_path = "<filepath>.asc"
data_dict =  read_file(file_path)

You can also import individual file readers.

from fairmat_readers_transmission import read_perkin_elmers_asc

file_path = "<filepath>.asc"
data_dict =  read_perkin_elmers_asc(file_path)

Currently, the following file extensions are supported:

File Extension Corresponding Reader Function
.asc read_perkin_elmers_asc

Development

The package is still under development. To contribute, start with simply raising an issue on the repo.

Contributing code

In case you want to contribute a piece of code, or a whole new reader, clone the repo in your local and start a virtual Python environment inside the directory.

git clone git@github.com:FAIRmat-NFDI/readers-transmission.git
cd readers-transmission
python3 -m venv .pyenv
source .pyenv/bin/activate

Then install the package in editable mode (-e flag), with dev dependencies. You can also run the pytest to confirm all went well. As a recommended practice, you can also install the pre-commit hook for linting (more on this here).

python -m pip install --upgrade pip
pip install -e .[dev]
pytest
pre-commit install

Now you can start tinkering around on a new branch (or a fork). If you want to contribute the code back to the upstream, simply create a Pull Request (PR), and we will get back to you. As a good practice, add tests for new readers and make sure existing tests (pytest) are passing before creating PR.

Ruff

We have placed GitHub actions for checking the linting. This can lead to your PR failing the CI tests in case your code is not correctly linted or formatted. Best way to avoid this is to use Ruff for automatic linting and formatting. This is already part of the dev environment and you can run Ruff before committing:

ruff check --fix
ruff format

Ruff pre-commit hook

Additionally, we also provide pre-commit hook for Ruff. This will run Ruff every time you try to commit and raise errors (and provide fixes) in case your code needs linting or formatting. You simply have to add these fixes and commit again.

To use this pre-commit hook, make sure to run the following in the terminal after you clone the repo:

pre-commit install

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

fairmat_readers_transmission-0.0.2.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file fairmat_readers_transmission-0.0.2.tar.gz.

File metadata

File hashes

Hashes for fairmat_readers_transmission-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9038c2402e91984ecd79c53b5adca1bf981b7b62be3405d6830dc84166fc2ea2
MD5 12afe947c14e9fd3c0a8e5caf523ab7b
BLAKE2b-256 17715fd70ceb6fa7991e683a19ee60dedbb73348365d97e69c68e8c0481eacbc

See more details on using hashes here.

File details

Details for the file fairmat_readers_transmission-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fairmat_readers_transmission-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bce6eba9a0160afa1f21dc46d12cc1b5754ea0c9db66732bea84992d3ecde9e4
MD5 7cd9b6e64dc69809da86382ec4d9ca2a
BLAKE2b-256 5b950e87572ea39a8e04aafa41b856f8ab089b7a7d5bd3e8fec2bef32bf1b058

See more details on using hashes here.

Supported by

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