Skip to content

Commit

Permalink
Merge pull request #16 from FAIRmat-NFDI/fix_normalization_function
Browse files Browse the repository at this point in the history
fixed norm in schema plugins
  • Loading branch information
JFRudzinski authored Jul 10, 2024
2 parents 1fe6c64 + 0f053e6 commit 05aca98
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/schema_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ Suppose you are developing a parser for a well-defined schema specified within t
```
hdf5_schema
+-- version: Integer[3]
\-- author
| +-- name: String[]
| +-- (email: String[])
\-- hdf5_generator
| +-- name: String[]
| +-- version: String[]
Expand Down Expand Up @@ -410,13 +407,17 @@ The normalization function within each schema section definition allows us to pe
if not self.contributions:
return

value = self.value
unknown_energy_exists = False
for contribution in self.contributions:
if not contribution.value:
continue
value = self.value - contribution.value
self.contributions.append(UnknownEnergy(value=value))

if contribution.name == 'UnknownEnergy':
unknown_energy_exists = True

value -= contribution.value
if not unknown_energy_exists:
self.contributions.append(UnknownEnergy(value=value))
```

!!! abstract "Assignment 4.6"
Expand Down

0 comments on commit 05aca98

Please sign in to comment.