Skip to content

Commit

Permalink
rename schema to catalysis
Browse files Browse the repository at this point in the history
  • Loading branch information
schumannj committed Jul 26, 2024
1 parent 2873fc2 commit f790909
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ class CatalysisElnCategory(EntryDataCategory):


def add_catalyst(archive: 'EntryArchive') -> None:
"""Adds metainfo structure for catalysis data to the results section of the supplied archive."""
'''
Adds metainfo structure for catalysis data to the results section of the supplied
archive.
'''
if not archive.results:
archive.results = Results()
if not archive.results.properties:
Expand All @@ -71,8 +74,8 @@ def add_catalyst(archive: 'EntryArchive') -> None:
archive.results.properties.catalytic.catalyst = Catalyst()


# helper function to retrieve nested attributes
def get_nested_attr(obj, attr_path):
'''helper function to retrieve nested attributes'''
for attr in attr_path.split('.'):
obj = getattr(obj, attr, None)
if obj is None:
Expand All @@ -81,6 +84,7 @@ def get_nested_attr(obj, attr_path):


def set_nested_attr(obj, attr_path, value):
'''helper function to set nested attributes'''
for attr in attr_path.split('.'):
obj = getattr(obj, attr, None)
if obj is None:
Expand Down
38 changes: 0 additions & 38 deletions src/nomad_catalysis/schema_packages/mypackage.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/data/test.archive.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data:
m_def: nomad_catalysis.schema_packages.schema.CatalystSample
m_def: nomad_catalysis.schema_packages.catalysis.CatalystSample
name: MoO3
catalyst_type: ['bulk catalyst']
description: 'Pressing and sieving of 24.22 g, Pressing conditions: 3 t, 1 min'
Expand Down

0 comments on commit f790909

Please sign in to comment.