nomad-coe / simulation-parsers

Apache License 2.0
0 stars 0 forks source link

Adapt new plugin structure #4

Open JosePizarro3 opened 1 month ago

JosePizarro3 commented 1 month ago

@ladinesa would you mind adapting the new plugin structure?

I would also like to request if we can rename the repo and the package to follow more the style I mentioned in the data repo: i.e., we call the repo "nomad-simulation-parsers" and the package is called "nomad_simulation_parsers".

We have to decide about the folder structure, but I'd go with the src thingy (then we will have src/nomad_simulation_parsers/... instead of simulationparsers).

Furthermore, can we change the content of the pyproject.toml to have:

[build-system]
requires = ["setuptools>=61.0.0", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"

[project]
name = 'simulationparsers'
version = '1.1'
description = 'Collection of NOMAD parsers for simulation codes.'
readme = "README.md"
authors = [
    { name = "Alvin Noe Ladines", email = "alvin.noe.ladines@physik.hu-berlin.de" },
    { name = "Jose M. Pizarro", email = "jose.pizarro@physik.hu-berlin.de" },
]
maintainers = [
    { name = "Alvin Noe Ladines", email = "alvin.noe.ladines@physik.hu-berlin.de" },
    { name = "Jose M. Pizarro", email = "jose.pizarro@physik.hu-berlin.de" },
]
license = { file = "LICENSE" }
requires-python = ">=3.9"
dependencies = [
    "nomad-lab>=1.2.0",
    "nomad-schema-plugin-run@git+https://github.com/nomad-coe/nomad-schema-plugin-run.git@develop",
]

[project.urls]
"Homepage" = "https://github.com/nomad-coe/simulation-parsers"
"Bug Tracker" = "https://github.com/nomad-coe/simulation-parsers/issues"

[project.optional-dependencies]
dev = [
    'mypy==1.0.1',
    'pytest>= 5.3.0, < 6.0.0',
    'pytest-timeout==1.4.2',
    'pytest-cov==2.7.1',
    'astroid==2.11.7',
    'typing-extensions==4.4.0',
    'ruff==0.1.4'
]

[tool.setuptools.packages.find]
where = [
    ".",
    "simulationparsers/abacus",
    "simulationparsers/wannier90",
    "simulationparsers/magres",
]

[tool.ruff]
include = ["simulationparsers/*.py", "tests/*.py"]
lint.select = [
    "E", # pycodestyle
    "W", # pycodestyle
    "PL", # pylint
]
lint.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
]
lint.fixable = ["ALL"]

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

[tool.ruff.format]
# use single quotes for strings.
quote-style = "single"

# indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[tool.setuptools.package-data]
simulationparsers = ['*/metadata.yaml', '*/README.md']

Adapting the proper paths? I am happy to discuss this.

And the other points! Let me know what you think 🙂

JosePizarro3 commented 1 month ago

Also, I am not sure why we have testing here. Is only for the utils? If so, I will delete it and move the utils to a specialized repo, nomad-simulation-utils. I will not bother on creating a specific for schemas and another for parsers atm.

ladinesa commented 1 month ago

sure i am ok with both. I am not familiar with the new structure tbh. Is it possible for you to make the restructuring?