Giter VIP home page Giter VIP logo

nomad-parser-plugin-test's Introduction

NOMAD's parser example plugin

Getting started

Fork the project

Go to the github project page https://github.com/nomad-coe/nomad-parser-plugin-example, hit fork (and leave a star, thanks!). Maybe you want to rename the project while forking!

Clone your fork

Follow the github instructions. The URL and directory depends on your user name or organization and the project name you choose. But, it should look somewhat like this:

git clone [email protected]:markus1978/my-nomad-schema.git
cd my-nomad-schema

Install the dependencies

You should create a virtual environment. You will need the nomad-lab package (and pytest). You need at least Python 3.9.

python3 -m venv .pyenv
source .pyenv/bin/activate
pip install -r requirements.txt --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple

Note! Until we have an official pypi NOMAD release with the plugins functionality. Make sure to include NOMAD's internal package registry (e.g. via --index-url). Follow the instructions in requirements.txt.

Run the tests

Make sure the current directory is in your path:

export PYTHONPATH=.

You can run automated tests with pytest:

pytest -svx tests

You can parse an example archive that uses the schema with nomad (installed via nomad-lab Python package):

nomad parse tests/data/test.example-format.txt --show-archive

Developing your schema

You can now start to develop you schema. Here are a few things that you might want to change:

  • The metadata in nomad_plugin.yaml.
  • The name of the Python package nomadparserexample. If you want to define multiple plugins, you can nest packages.
  • The name of the example parser ExampleParser and the schema definitions it might define.
  • When you change module and class names, make sure to update the nomad_plugin.yaml accordingly.

To learn more about plugins, how to add them to an Oasis, how to publish them, read our documentation on plugins: https://nomad-lab/prod/v1/staging/docs/plugins.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.