Skip to content

Commit

Permalink
Fix: Refactor plugin name and module to uibk-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianschoeppach committed May 29, 2024
1 parent aff0cfc commit 2b6b4ea
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions .cruft.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"full_name": "Fabian Schöppach",
"email": "fabian.schoeppach@physik.hu-berlin.de",
"github_username": "fabianschoeppach",
"plugin_name": "ubik-plugin",
"module_name": "ubik_plugin",
"short_description": "UBIK schema and parser collection for NOMAD plattform.",
"plugin_name": "uibk-plugin",
"module_name": "uibk_plugin",
"short_description": "UIBK schema and parser collection for NOMAD plattform.",
"version": "0.1.0",
"license": "Apache Software License 2.0",
"include_schema_package": true,
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nomad-ubik-plugin
# nomad-uibk-plugin

UBIK schema and parser collection for NOMAD plattform.
UIBK schema and parser collection for NOMAD plattform.

----

Expand Down Expand Up @@ -62,15 +62,15 @@ python -m build --sdist
You can install the package with pip:

```
pip install dist/nomad-ubik-plugin-0.1.0
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](https://packaging.python.org/en/latest/tutorials/packaging-projects/).

### Documentation on Github pages

To deploy documentation on Github pages, make sure to [enable GitHub pages via the repo settings](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-from-a-branch).
To deploy documentation on Github pages, make sure to [enable GitHub pages via the repo settings](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-from-a-branch).

To view the documentation locally, install the documentation related packages using:

Expand All @@ -85,9 +85,9 @@ mkdocs serve

### 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](https://github.blog/changelog/2022-05-03-github-actions-prevent-github-actions-from-creating-and-approving-pull-requests/) on how to enable Github Actions to create pull requests.
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](https://github.blog/changelog/2022-05-03-github-actions-prevent-github-actions-from-creating-and-approving-pull-requests/) on how to enable Github Actions to create pull requests.

To run the check for updates locally, follow the instructions on [`cruft` website](https://cruft.github.io/cruft/#updating-a-project).

### License
Distributed under the terms of the `Apache Software License 2.0`_ license, "nomad-ubik-plugin" is free and open source software
Distributed under the terms of the `Apache Software License 2.0`_ license, "nomad-uibk-plugin" is free and open source software
4 changes: 2 additions & 2 deletions docs/how_to/contribute_to_this_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This code is currently under development. To contribute to this project, you should clone the respective repository, [install it](install_this_plugin.md) and create a pull request following the standard procedure.:

```sh
git clone git@github.com:fabianschoeppach/nomad-UBIK-plugin.git
cd nomad-UBIK-plugin
git clone git@github.com:fabianschoeppach/nomad-UIBK-plugin.git
cd nomad-UIBK-plugin
```

## Contribute to the Documentation
Expand Down
2 changes: 1 addition & 1 deletion docs/how_to/install_this_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## For Usage in an NOMAD Distribution Image

To use this plugin in an NOMAD distribution image such as [this one](https://github.com/fabianschoeppach/nomad-UBIK-image) simply list it in the `plugin.txt`.
To use this plugin in an NOMAD distribution image such as [this one](https://github.com/fabianschoeppach/nomad-UIBK-image) simply list it in the `plugin.txt`.

## Stand alone

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Welcome to the `nomad-ubik-plugin` documentation
# Welcome to the `nomad-uibk-plugin` documentation

## Introduction

Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
site_name: nomad-ubik-plugin
site_description: UBIK schema and parser collection for NOMAD plattform.
site_name: nomad-uibk-plugin
site_description: UIBK schema and parser collection for NOMAD plattform.
site_author: Fabian Schöppach

repo_url: https://github.com/fabianschoeppach/nomad-ubik-plugin
repo_url: https://github.com/fabianschoeppach/nomad-uibk-plugin

nav:
- Home: index.md
Expand Down
4 changes: 2 additions & 2 deletions move_template_files.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

rsync -avh nomad-ubik-plugin/ .
rm -rfv nomad-ubik-plugin
rsync -avh nomad-uibk-plugin/ .
rm -rfv nomad-uibk-plugin
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
]
name = "nomad-ubik-plugin"
description = "UBIK schema and parser collection for NOMAD plattform."
name = "nomad-uibk-plugin"
description = "UIBK schema and parser collection for NOMAD plattform."
version = "0.1.0"
readme = "README.rst"
requires-python = ">=3.9"
Expand All @@ -31,7 +31,7 @@ dependencies = [
]

[project.urls]
Repository = "https://github.com/fabianschoeppach/nomad-ubik-plugin"
Repository = "https://github.com/fabianschoeppach/nomad-uibk-plugin"

[project.optional-dependencies]
dev = ["ruff", "pytest", "structlog"]
Expand Down Expand Up @@ -111,7 +111,7 @@ package-dir = { "" = "src" }
where = ["src"]

[project.entry-points.'nomad.plugin']
myparser = "nomad_ubik_plugin.parsers:myparser"
mypackage = "nomad_ubik_plugin.schema_packages:mypackage"
xrfschema = "nomad_ubik_plugin.schema_packages:xrfschema"
xrfparser = "nomad_ubik_plugin.parsers:xrfparser"
myparser = "nomad_uibk_plugin.parsers:myparser"
mypackage = "nomad_uibk_plugin.schema_packages:mypackage"
xrfschema = "nomad_uibk_plugin.schema_packages:xrfschema"
xrfparser = "nomad_uibk_plugin.parsers:xrfparser"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
from nomad.parsing.parser import MatchingParser
from nomad_measurements.utils import create_archive

from nomad_ubik_plugin.schema_packages.XRFschema import ELNXRayFluorescence
from nomad_uibk_plugin.schema_packages.XRFschema import ELNXRayFluorescence

if TYPE_CHECKING:
from nomad.datamodel.datamodel import EntryArchive
from structlog.stdlib import BoundLogger

configuration = config.get_plugin_entry_point('nomad_ubik_plugin.parsers:xrfparser')
configuration = config.get_plugin_entry_point('nomad_uibk_plugin.parsers:xrfparser')


class RawFileXRFData(EntryData):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class MyParserEntryPoint(ParserEntryPoint):
parameter: int = Field(0, description='Custom configuration parameter')

def load(self):
from nomad_ubik_plugin.parsers.myparser import MyParser
from nomad_uibk_plugin.parsers.myparser import MyParser

return MyParser(**self.dict())

Expand All @@ -25,14 +25,14 @@ class XRFParserEntryPoint(ParserEntryPoint):

def load(self):
# lazy import to avoid circular dependencies
from nomad_ubik_plugin.parsers.XRFparser import XRFParser
from nomad_uibk_plugin.parsers.XRFparser import XRFParser

return XRFParser(**self.dict())


xrfparser = XRFParserEntryPoint(
name='XRFParser',
description='XRF Parser for UBIK .txt files.',
description='XRF Parser for UIBK .txt files.',
mainfile_name_re='.*\.txt',
mainfile_content_re='PositionType\s+Application\s+Sample\s+name\s+Date\s+\n[A-Z0-9-]+\s+Quant\s+analysis',
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from nomad.parsing.parser import MatchingParser

configuration = config.get_plugin_entry_point(
'nomad_ubik_plugin.parsers:myparser'
'nomad_uibk_plugin.parsers:myparser'
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def group_composition_into_layers(
)
elif logger is not None:
logger.warn(
'read_UBIK_txt found unknown unit "{unit}" '
'read_UIBK_txt found unknown unit "{unit}" '
'in file: "{file_path}"'
)
return layers
Expand Down Expand Up @@ -135,7 +135,7 @@ def sort_intensity_values_into_layers( # noqa: PLR0913

def read_xrf_txt(file_path: str, logger: 'BoundLogger' = None) -> dict[str, Any]: # noqa: PLR0915, PLR0912
"""
Function for reading the X-ray fluorescence data in a UBIK `.txt` file.
Function for reading the X-ray fluorescence data in a UIBK `.txt` file.
Args:
file_path (str): The path to the `.txt` file.
Expand Down Expand Up @@ -262,7 +262,7 @@ def read_xrf_txt(file_path: str, logger: 'BoundLogger' = None) -> dict[str, Any]
):
if logger is not None:
logger.warn(
'read_UBIK_txt found inconsistent number of '
'read_UIBK_txt found inconsistent number of '
'intensity values in file: "{file_path}"'
)

Expand Down Expand Up @@ -291,12 +291,12 @@ def read_xrf_txt(file_path: str, logger: 'BoundLogger' = None) -> dict[str, Any]
xrf_dict[application]['layers'] = layers
elif logger is not None:
logger.warn(
'read_UBIK_txt found duplicate application "{application}"'
'read_UIBK_txt found duplicate application "{application}"'
' in file: "{file_path}".'
)
elif logger is not None:
logger.warn(
'read_UBIK_txt failed to extract all necessary information '
'read_UIBK_txt failed to extract all necessary information '
'from file: "{file_path}"'
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@
)
from nomad_measurements.utils import merge_sections

from nomad_ubik_plugin.schema_packages import XRFreader
from nomad_uibk_plugin.schema_packages import XRFreader

if TYPE_CHECKING:
from structlog.stdlib import BoundLogger

configuration = config.get_plugin_entry_point(
'nomad_ubik_plugin.schema_packages:xrfschema'
'nomad_uibk_plugin.schema_packages:xrfschema'
)

m_package = SchemaPackage(name='nomad_xrf')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class MySchemaPackageEntryPoint(SchemaPackageEntryPoint):
parameter: int = Field(0, description='Custom configuration parameter')

def load(self):
from nomad_ubik_plugin.schema_packages.mypackage import m_package
from nomad_uibk_plugin.schema_packages.mypackage import m_package

return m_package

Expand All @@ -20,7 +20,7 @@ class XRFSchemaPackageEntryPoint(SchemaPackageEntryPoint):
parameter: int = Field(0, description='Custom configuration parameter')

def load(self):
from nomad_ubik_plugin.schema_packages.XRFschema import m_package
from nomad_uibk_plugin.schema_packages.XRFschema import m_package

return m_package

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from nomad.metainfo import Quantity, SchemaPackage

configuration = config.get_plugin_entry_point(
'nomad_ubik_plugin.schema_packages:mypackage'
'nomad_uibk_plugin.schema_packages:mypackage'
)

m_package = SchemaPackage()
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test.archive.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
data:
m_def: nomad_ubik_plugin.schema_packages.mypackage.MySchema
m_def: nomad_uibk_plugin.schema_packages.mypackage.MySchema
name: Markus
2 changes: 1 addition & 1 deletion tests/parsers/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

from nomad.datamodel import EntryArchive
from nomad_ubik_plugin.parsers.myparser import MyParser
from nomad_uibk_plugin.parsers.myparser import MyParser


def test_parse_file():
Expand Down

0 comments on commit 2b6b4ea

Please sign in to comment.