Skip to content

Commit

Permalink
refactor plugin structure (#69)
Browse files Browse the repository at this point in the history
* refactored structure

* updated toml file and relaunched ruff linting

* further lintage activities

* fixed ruff formatting and test files

* reverted nomad-lab version in toml

* added aliases and updated README

* extended conductivity-type quantity

* added carrier density deviation quantity

* harmonized type=float everywhere

* remove unused import

* filled default values in special Geometry shapes

* Bump up nomad-lab to 1.3.4dev

* fixed reference to substrate holder

* InsertReduction class refinements

* fixed InsertReduction reference

* refined recipe classes

* refined recipe classes

* added starting and ending T in annealing step

* Update src/nomad_material_processing/solution/__init__.py

Co-authored-by: Sarthak Kapoor <[email protected]>

* reformatting

* check if aliases work

* reverted m_def to old paths in test files

* reverted solution m_def

* reverted nomad_material_processing.vapor_deposition.pvd.general.PhysicalVaporDeposition

* added print statement in tests

* added print statement in tests

* Explicitely load metainfo before tests. (#72)

Co-authored-by: Hampus Näsström <[email protected]>

* remove unused import

* formatting

---------

Co-authored-by: Sarthak Kapoor <[email protected]>
Co-authored-by: Sarthak Kapoor <[email protected]>
Co-authored-by: Markus Scheidgen <[email protected]>
Co-authored-by: Hampus Näsström <[email protected]>
  • Loading branch information
5 people committed Sep 10, 2024
1 parent 6179e33 commit 48a0f82
Show file tree
Hide file tree
Showing 35 changed files with 3,214 additions and 2,757 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ material processing.
pip install nomad-material-processing
```

### Setting up your OASIS
Read the [NOMAD plugin documentation](https://nomad-lab.eu/prod/v1/staging/docs/plugins/plugins.html#add-a-plugin-to-your-nomad) for all details on how to deploy the plugin on your NOMAD instance.

You don't need to modify the ```nomad.yaml``` configuration file of your NOMAD instance, beacuse the package is pip installed and all the available modules (entry points) are loaded.
To include, instead, only some of the entry points, you need to specify them in the ```include``` section of the ```nomad.yaml```. In the following lines, a list of all the available entry points:

```yaml
plugins:
include:
- "nomad_material_processing:schema"
- "nomad_material_processing.solution:schema"
- "nomad_material_processing.vapor_deposition.cvd:schema"
- "nomad_material_processing.vapor_deposition.pvd:schema"
- "nomad_material_processing.vapor_deposition.pvd:mbe_schema"
- "nomad_material_processing.vapor_deposition.pvd:pld_schema"
- "nomad_material_processing.vapor_deposition.pvd:sputtering_schema"
- "nomad_material_processing.vapor_deposition.pvd:thermal_schema"
```
### Development
This code is currently under development and for installing and contributing you should clone the repository:
```sh
Expand Down
10 changes: 0 additions & 10 deletions nomad.yaml

This file was deleted.

116 changes: 78 additions & 38 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,101 @@ requires = [
build-backend = "setuptools.build_meta"

[project]
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
]
name = "nomad-material-processing"
dynamic = ["version"]
description = "A plugin for NOMAD containing base sections for material processing."
readme = "README.md"
authors = [
{ name = "Sarthak Kapoor", email = '[email protected]' },
{ name = "Hampus Näsström", email = '[email protected]' },
{ name = "Andrea Albino", email = '[email protected]' },
{ name = "Sebastian Brückner", email = '[email protected]' },
]
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: Apache Software License",
]
license = { file = "LICENSE" }
dependencies = [
"nomad-lab>=1.3.3.dev86",
]
[project.optional-dependencies]
dev = [
"pytest",
"ruff",
"structlog>=22.3.0",
"nomad-lab>=1.3.4dev",
]

[project.license]
file = "LICENSE"

[project.urls]
"Homepage" = "https://github.com/FAIRmat-NFDI/nomad-material-processing"
"Bug Tracker" = "https://github.com/FAIRmat-NFDI/nomad-material-processing/issues"

[tool.uv]
index-url = "https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple"


[project.optional-dependencies]
dev = [
"pytest",
"ruff",
"structlog",
]

[tool.ruff]
include = ["src/*.py", "tests/*.py"]

exclude = ["dependencies"]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]

# Same as Black.
line-length = 88
indent-width = 4

[tool.ruff.lint]
select = [
"E", # pycodestyle
"W", # pycodestyle
"PL", # pylint
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# isort
"I",
# pylint
"PL",
]

ignore = [
"E501", # Line too long ({width} > {limit} characters)
"E701", # Multiple statements on one line (colon)
"E731", # Do not assign a lambda expression, use a def
"E402", # Module level import not at top of file
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments in function definition
"PLR0915", # Too many statements
"PLR2004", # Magic value used instead of constant
"PLW0603", # Using the global statement
"PLW2901", # redefined-loop-name
"PLR1714", # consider-using-in
"PLR5501", # else-if-used
"F403", # 'from module import *' used; unable to detect undefined names
]

fixable = ["ALL"]

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# this is entirely optional, you can remove this if you wish to
[tool.ruff.format]
# use single quotes for strings.
quote-style = "single"
Expand All @@ -87,9 +114,22 @@ skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[tool.setuptools]
package-dir = { "" = "src" }

[tool.setuptools.packages.find]
where = [
"src",
]
where = ["src"]

[project.entry-points.'nomad.plugin']

general_schema = "nomad_material_processing:schema"
solution_schema = "nomad_material_processing.solution:schema"
vd_schema = "nomad_material_processing.vapor_deposition:schema"
cvd_schema = "nomad_material_processing.vapor_deposition.cvd:schema"
pvd_schema = "nomad_material_processing.vapor_deposition.pvd:schema"
mbe_schema = "nomad_material_processing.vapor_deposition.pvd:mbe_schema"
pld_schema = "nomad_material_processing.vapor_deposition.pvd:pld_schema"
sputtering_schema = "nomad_material_processing.vapor_deposition.pvd:sputtering_schema"
thermal_schema = "nomad_material_processing.vapor_deposition.pvd:thermal_schema"

[tool.setuptools_scm]
Loading

0 comments on commit 48a0f82

Please sign in to comment.