From 819126b9fe2596a5c67bd847d815749130028d9c Mon Sep 17 00:00:00 2001 From: Pepe Marquez Date: Fri, 17 May 2024 08:51:03 +0200 Subject: [PATCH] Changed folder layout. --- pyproject.toml | 2 +- .../__init__.py | 19 ++++++++++++++++++ .../data_tools/AM15G.dat.txt | 0 .../data_tools/README.md | 0 .../data_tools/__init__.py | 0 .../data_tools/entry_writer.py | 0 .../data_tools/eqe_parser.py | 0 .../data_tools/jv_parser.py | 0 ...skite_solar_cell_database.py => schema.py} | 4 +--- .../schema_packages/__init__.py | 19 ------------------ .../schema_sections/__init__.py | 0 .../schema_sections/add.py | 0 .../schema_sections/backcontact.py | 0 .../schema_sections/cell.py | 0 .../schema_sections/encapsulation.py | 0 .../schema_sections/eqe.py | 0 .../schema_sections/etl.py | 0 .../schema_sections/formula_normalizer.py | 0 .../schema_sections/htl.py | 0 .../schema_sections/ions/A-ion_data.xlsx | Bin .../schema_sections/ions/B-ion_data.xlsx | Bin .../schema_sections/ions/C-ion_data.xlsx | Bin .../schema_sections/ions/__init__.py | 0 .../schema_sections/ions/ion.py | 0 .../schema_sections/ions/ion_vars.py | 0 .../schema_sections/jv.py | 0 .../schema_sections/module.py | 0 .../schema_sections/outdoor.py | 0 .../schema_sections/perovskite.py | 0 .../schema_sections/perovskite_deposition.py | 0 .../schema_sections/ref.py | 0 .../schema_sections/stabilised.py | 0 .../schema_sections/stability.py | 0 .../schema_sections/substrate.py | 0 .../schema_sections/utils.py | 0 .../schema_sections/vars.py | 0 tests/data/example.archive.json | 2 +- 37 files changed, 22 insertions(+), 24 deletions(-) rename src/perovskite_solar_cell_database/{schema_packages => }/data_tools/AM15G.dat.txt (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/data_tools/README.md (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/data_tools/__init__.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/data_tools/entry_writer.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/data_tools/eqe_parser.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/data_tools/jv_parser.py (100%) rename src/perovskite_solar_cell_database/{schema_packages/perovskite_solar_cell_database.py => schema.py} (93%) delete mode 100644 src/perovskite_solar_cell_database/schema_packages/__init__.py rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/__init__.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/add.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/backcontact.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/cell.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/encapsulation.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/eqe.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/etl.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/formula_normalizer.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/htl.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/ions/A-ion_data.xlsx (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/ions/B-ion_data.xlsx (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/ions/C-ion_data.xlsx (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/ions/__init__.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/ions/ion.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/ions/ion_vars.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/jv.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/module.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/outdoor.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/perovskite.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/perovskite_deposition.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/ref.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/stabilised.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/stability.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/substrate.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/utils.py (100%) rename src/perovskite_solar_cell_database/{schema_packages => }/schema_sections/vars.py (100%) diff --git a/pyproject.toml b/pyproject.toml index d4dc2dc..b94a984 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,6 +121,6 @@ where = ["src"] [project.entry-points.'nomad.plugin'] -perovskite_solar_cell_database = "perovskite_solar_cell_database.schema_packages:perovskite_solar_cell_database" +perovskite_solar_cell_database = "perovskite_solar_cell_database:schema" # myapp = "nomad_solar_cells_efficiency_tables.apps:myapp" \ No newline at end of file diff --git a/src/perovskite_solar_cell_database/__init__.py b/src/perovskite_solar_cell_database/__init__.py index e69de29..0c43d92 100644 --- a/src/perovskite_solar_cell_database/__init__.py +++ b/src/perovskite_solar_cell_database/__init__.py @@ -0,0 +1,19 @@ +from nomad.config.models.plugins import SchemaPackageEntryPoint +from pydantic import Field + + +class PerovskiteDatabasePackageEntryPoint(SchemaPackageEntryPoint): + # parameter: int = Field(0, description='Custom configuration parameter') + + def load(self): + from perovskite_solar_cell_database.schema import ( + m_package, + ) + + return m_package + + +schema = PerovskiteDatabasePackageEntryPoint( + name='PerovskiteSolarCell', + description='Schema package defined for the perovskite solar cells database.', +) diff --git a/src/perovskite_solar_cell_database/schema_packages/data_tools/AM15G.dat.txt b/src/perovskite_solar_cell_database/data_tools/AM15G.dat.txt similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/data_tools/AM15G.dat.txt rename to src/perovskite_solar_cell_database/data_tools/AM15G.dat.txt diff --git a/src/perovskite_solar_cell_database/schema_packages/data_tools/README.md b/src/perovskite_solar_cell_database/data_tools/README.md similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/data_tools/README.md rename to src/perovskite_solar_cell_database/data_tools/README.md diff --git a/src/perovskite_solar_cell_database/schema_packages/data_tools/__init__.py b/src/perovskite_solar_cell_database/data_tools/__init__.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/data_tools/__init__.py rename to src/perovskite_solar_cell_database/data_tools/__init__.py diff --git a/src/perovskite_solar_cell_database/schema_packages/data_tools/entry_writer.py b/src/perovskite_solar_cell_database/data_tools/entry_writer.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/data_tools/entry_writer.py rename to src/perovskite_solar_cell_database/data_tools/entry_writer.py diff --git a/src/perovskite_solar_cell_database/schema_packages/data_tools/eqe_parser.py b/src/perovskite_solar_cell_database/data_tools/eqe_parser.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/data_tools/eqe_parser.py rename to src/perovskite_solar_cell_database/data_tools/eqe_parser.py diff --git a/src/perovskite_solar_cell_database/schema_packages/data_tools/jv_parser.py b/src/perovskite_solar_cell_database/data_tools/jv_parser.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/data_tools/jv_parser.py rename to src/perovskite_solar_cell_database/data_tools/jv_parser.py diff --git a/src/perovskite_solar_cell_database/schema_packages/perovskite_solar_cell_database.py b/src/perovskite_solar_cell_database/schema.py similarity index 93% rename from src/perovskite_solar_cell_database/schema_packages/perovskite_solar_cell_database.py rename to src/perovskite_solar_cell_database/schema.py index f0b4337..be0f67b 100644 --- a/src/perovskite_solar_cell_database/schema_packages/perovskite_solar_cell_database.py +++ b/src/perovskite_solar_cell_database/schema.py @@ -33,9 +33,7 @@ ) from nomad.metainfo import Package, Section, SubSection, SchemaPackage -configuration = config.get_plugin_entry_point( - 'perovskite_solar_cell_database.schema_packages:perovskite_solar_cell_database' -) +configuration = config.get_plugin_entry_point('perovskite_solar_cell_database:schema') m_package = SchemaPackage() diff --git a/src/perovskite_solar_cell_database/schema_packages/__init__.py b/src/perovskite_solar_cell_database/schema_packages/__init__.py deleted file mode 100644 index 9f2f051..0000000 --- a/src/perovskite_solar_cell_database/schema_packages/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -from nomad.config.models.plugins import SchemaPackageEntryPoint -from pydantic import Field - - -class PerovskiteDatabasePackageEntryPoint(SchemaPackageEntryPoint): - # parameter: int = Field(0, description='Custom configuration parameter') - - def load(self): - from perovskite_solar_cell_database.schema_packages.perovskite_solar_cell_database import ( - m_package, - ) - - return m_package - - -perovskite_solar_cell_database = PerovskiteDatabasePackageEntryPoint( - name='PerovskiteSolarCell', - description='Schema package defined for the perovskite solar cells database.', -) diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/__init__.py b/src/perovskite_solar_cell_database/schema_sections/__init__.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/__init__.py rename to src/perovskite_solar_cell_database/schema_sections/__init__.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/add.py b/src/perovskite_solar_cell_database/schema_sections/add.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/add.py rename to src/perovskite_solar_cell_database/schema_sections/add.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/backcontact.py b/src/perovskite_solar_cell_database/schema_sections/backcontact.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/backcontact.py rename to src/perovskite_solar_cell_database/schema_sections/backcontact.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/cell.py b/src/perovskite_solar_cell_database/schema_sections/cell.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/cell.py rename to src/perovskite_solar_cell_database/schema_sections/cell.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/encapsulation.py b/src/perovskite_solar_cell_database/schema_sections/encapsulation.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/encapsulation.py rename to src/perovskite_solar_cell_database/schema_sections/encapsulation.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/eqe.py b/src/perovskite_solar_cell_database/schema_sections/eqe.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/eqe.py rename to src/perovskite_solar_cell_database/schema_sections/eqe.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/etl.py b/src/perovskite_solar_cell_database/schema_sections/etl.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/etl.py rename to src/perovskite_solar_cell_database/schema_sections/etl.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/formula_normalizer.py b/src/perovskite_solar_cell_database/schema_sections/formula_normalizer.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/formula_normalizer.py rename to src/perovskite_solar_cell_database/schema_sections/formula_normalizer.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/htl.py b/src/perovskite_solar_cell_database/schema_sections/htl.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/htl.py rename to src/perovskite_solar_cell_database/schema_sections/htl.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/A-ion_data.xlsx b/src/perovskite_solar_cell_database/schema_sections/ions/A-ion_data.xlsx similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/A-ion_data.xlsx rename to src/perovskite_solar_cell_database/schema_sections/ions/A-ion_data.xlsx diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/B-ion_data.xlsx b/src/perovskite_solar_cell_database/schema_sections/ions/B-ion_data.xlsx similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/B-ion_data.xlsx rename to src/perovskite_solar_cell_database/schema_sections/ions/B-ion_data.xlsx diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/C-ion_data.xlsx b/src/perovskite_solar_cell_database/schema_sections/ions/C-ion_data.xlsx similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/C-ion_data.xlsx rename to src/perovskite_solar_cell_database/schema_sections/ions/C-ion_data.xlsx diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/__init__.py b/src/perovskite_solar_cell_database/schema_sections/ions/__init__.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/__init__.py rename to src/perovskite_solar_cell_database/schema_sections/ions/__init__.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/ion.py b/src/perovskite_solar_cell_database/schema_sections/ions/ion.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/ion.py rename to src/perovskite_solar_cell_database/schema_sections/ions/ion.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/ion_vars.py b/src/perovskite_solar_cell_database/schema_sections/ions/ion_vars.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/ions/ion_vars.py rename to src/perovskite_solar_cell_database/schema_sections/ions/ion_vars.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/jv.py b/src/perovskite_solar_cell_database/schema_sections/jv.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/jv.py rename to src/perovskite_solar_cell_database/schema_sections/jv.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/module.py b/src/perovskite_solar_cell_database/schema_sections/module.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/module.py rename to src/perovskite_solar_cell_database/schema_sections/module.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/outdoor.py b/src/perovskite_solar_cell_database/schema_sections/outdoor.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/outdoor.py rename to src/perovskite_solar_cell_database/schema_sections/outdoor.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/perovskite.py b/src/perovskite_solar_cell_database/schema_sections/perovskite.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/perovskite.py rename to src/perovskite_solar_cell_database/schema_sections/perovskite.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/perovskite_deposition.py b/src/perovskite_solar_cell_database/schema_sections/perovskite_deposition.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/perovskite_deposition.py rename to src/perovskite_solar_cell_database/schema_sections/perovskite_deposition.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/ref.py b/src/perovskite_solar_cell_database/schema_sections/ref.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/ref.py rename to src/perovskite_solar_cell_database/schema_sections/ref.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/stabilised.py b/src/perovskite_solar_cell_database/schema_sections/stabilised.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/stabilised.py rename to src/perovskite_solar_cell_database/schema_sections/stabilised.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/stability.py b/src/perovskite_solar_cell_database/schema_sections/stability.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/stability.py rename to src/perovskite_solar_cell_database/schema_sections/stability.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/substrate.py b/src/perovskite_solar_cell_database/schema_sections/substrate.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/substrate.py rename to src/perovskite_solar_cell_database/schema_sections/substrate.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/utils.py b/src/perovskite_solar_cell_database/schema_sections/utils.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/utils.py rename to src/perovskite_solar_cell_database/schema_sections/utils.py diff --git a/src/perovskite_solar_cell_database/schema_packages/schema_sections/vars.py b/src/perovskite_solar_cell_database/schema_sections/vars.py similarity index 100% rename from src/perovskite_solar_cell_database/schema_packages/schema_sections/vars.py rename to src/perovskite_solar_cell_database/schema_sections/vars.py diff --git a/tests/data/example.archive.json b/tests/data/example.archive.json index a491fa6..99b94fe 100644 --- a/tests/data/example.archive.json +++ b/tests/data/example.archive.json @@ -1,6 +1,6 @@ { "data": { - "m_def": "perovskite_solar_cell_database.schema_packages.perovskite_solar_cell_database.PerovskiteSolarCell", + "m_def": "perovskite_solar_cell_database.schema.PerovskiteSolarCell", "ref": { "ID": 36709, "ID_temp": 36709,