Skip to content

fabianschoeppach/nomad-UIBK-plugin

Repository files navigation

nomad-uibk-plugin

Python Version GitHub Issues License

This software is a plugin for the NOMAD research data management system.
It provides a collection of schemas and parsers tailored to measurement methods around fundamental solar cell research.
It is intended to run on a self-hosted version of NOMAD called Oasis.

Installation

For Usage in an NOMAD Distribution Image

To use this plugin in an NOMAD distribution image such as this one simply list it in the plugin.txt and generate a new image.

Stand alone installation and/or to customize the plugin

To install this package, it is recommended to create and activate a virtual environment. This practice isolates the package dependencies and prevents conflicts with other globally installed Python packages. Since the codebase of NOMAD is currently based on Python 3.9, using that version is recommended.

python3.9 -m venv .pyenv
source .pyenv/bin/activate

The nomad-lab package is needed to use and test the plugin functionalities:

pip install --upgrade pip
pip install -e '.[dev]' --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple

Note: As of now, there is no official pypi NOMAD release with the plugin functionality. Therefore, make sure to include internal package registry of NOMAD (e.g. via --index-url).

Testing

You can run automated tests with pytest:

pytest -svx tests

Run linting

ruff check .

Run auto-formatting

This is entirely optional. To add this as a check in github actions pipeline, uncomment the ruff-formatting step in ./github/workflows/actions.yaml.

ruff format .

Developing a NOMAD plugin

Follow the guide on how to develop NOMAD plugins.

Build the python package

The pyproject.toml file contains everything that is necessary to turn the project into a pip installable python package. Run the python build tool to create a package distribution:

pip install build
python -m build --sdist

You can install the package with pip:

pip install dist/nomad-uibk-plugin-0.1.0

Read more about python packages, pyproject.toml, and how to upload packages to PyPI on the PyPI documentation.

Technical details

This plugin was generated with Cookiecutter along with NOMAD's cookiecutter-nomad-plugin template.

Template update

We use cruft to update the project based on template changes. A cruft-update.yml is included in Github workflows to automatically check for updates and create pull requests to apply updates.
Follow the instructions on how to enable Github Actions to create pull requests.

To run the check for updates locally, follow the instructions on cruft website.

Documentation on Github pages

This project uses mkdocs and a automatic Github Workflow to deploy its documentation. Its content is entirely stored within markdown files (.md) in the docs/ directory.

To view the documentation locally, install the documentation related packages and run the documentation server:

pip install -r requirements_docs.txt
mkdocs serve

License

Distributed under the terms of the Apache Software License 2.0. nomad-uibk-plugin is free and open source software.