diff --git a/src/nomad_greenlight_plugin/parsers/__init__.py b/src/nomad_greenlight_plugin/parsers/__init__.py index c5a5943..229beab 100644 --- a/src/nomad_greenlight_plugin/parsers/__init__.py +++ b/src/nomad_greenlight_plugin/parsers/__init__.py @@ -14,5 +14,6 @@ def load(self): parser_entry_point = GreenlightParserEntryPoint( name='GreenlightParser', description='Greenlight parser entry point configuration.', - mainfile_content_re='\s*\n\s*Emerald Version', + # mainfile_name_re='.greenlight.', + mainfile_contents_re='\s*\n\s*Emerald Version', ) diff --git a/src/nomad_greenlight_plugin/parsers/parser.py b/src/nomad_greenlight_plugin/parsers/parser.py index 1fea119..4356e62 100644 --- a/src/nomad_greenlight_plugin/parsers/parser.py +++ b/src/nomad_greenlight_plugin/parsers/parser.py @@ -11,7 +11,6 @@ ) # Import additional libraries -import os from echem_data import electrochem_data as ed from nomad.config import config @@ -40,13 +39,13 @@ def parse( archive.workflow2 = Workflow(name='test') data_file_object = ed.EChemDataFile(mainfile, 'Greenlight') - archive.metadata.entry_name = os.path.basename(mainfile) + # archive.metadata.entry_name = os.path.basename(mainfile) # archive.metadata.external_id = data[0][1:] archive.data = GreenlightSchemaPackage() print(data_file_object.data.columns) - archive.data.test_name = data_file_object.header['Test Name'] + archive.data.name = data_file_object.header['Test Name'] archive.data.cell_voltage = data_file_object.data['cell_voltage_total'] # archive.data.cell_voltage.unit = data_file_object.units['cell_voltage_total'] archive.data.current_density = data_file_object.data['current_density'] # archive.data.current_density.unit = data_file_object.units['current_density'] - archive.data.current = data_file_object.data['current'] \ No newline at end of file + #archive.data.current = data_file_object.data['current'] \ No newline at end of file diff --git a/tests/schema_packages/test_schema_package.py b/tests/schema_packages/test_schema_package.py index 4e7b746..cde4939 100644 --- a/tests/schema_packages/test_schema_package.py +++ b/tests/schema_packages/test_schema_package.py @@ -5,7 +5,12 @@ def test_schema_package(): test_file = os.path.join('tests', 'data', 'test.archive.yaml') + # test_file = os.path.join('..', 'data', 'test.archive.yaml') + entry_archive = parse(test_file)[0] normalize_all(entry_archive) assert entry_archive.data.message == 'Hello Markus!' + + +test_schema_package()