A package containing file readers for XRD raw files.
Project description
fairmat-readers-xrd
A package developed by FAIRmat and collaborators that contains file readers for various X-ray diffraction (XRD) 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-xrd
from fairmat_readers_xrd import read_file
file_path = "<filepath>.xrdml"
data_dict = read_file(file_path)
You can also import individual file readers.
from fairmat_readers_xrd import read_panalytical_xrdml
file_path = "<filepath>.xrdml"
data_dict = read_panalytical_xrdml(file_path)
Currently, the following file extensions are supported:
File Extension | Corresponding Reader Function |
---|---|
.xrdml |
read_panalytical_xrdml |
.rasx |
read_rigaku_rasx |
.brml |
read_bruker_brml |
Development
The package is still under development. To contribute, start with simply raising an issue on the repo. 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-xrd.git
cd readers-xrd
python3.9 -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.
python -m pip install --upgrade pip
pip install -e .[dev]
pytest
Now you can start tinkering around. We recommend to create a new branch for this. 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 are passing before creating PR.
You can also use Ruff
for automatic linting by running the following:
ruff format .
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
Built Distribution
Hashes for fairmat_readers_xrd-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7f35ece73f561c04c93f9d10c7ac21b300a3f936797f7231430ffe099bba801 |
|
MD5 | 233cfb9ba661c52607e1d77e4d8c1a3c |
|
BLAKE2b-256 | 264f237378ea53a6ab285aef602563acb4b16b61724682364e0a17decccdbc86 |
Hashes for fairmat_readers_xrd-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cd9579525f06c0a060fc1edc10fccf0e66de065f1dc2ee24abbfe229431ded4 |
|
MD5 | 7c78266542aec22103bda15241a0562a |
|
BLAKE2b-256 | 663e0d85fe3b367f27f2b80a0e453b1905c5fe4ecd9f368e9fe54d9a73cd7c00 |