Commit 59bce5dc authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed unit definition

parent 3a5d0ae6
......@@ -65,7 +65,7 @@ class MyParserImplementation1():
result.
"""
result = Result()
result.unit = ureg.joule
result.unit = "joule"
result.value = 2.0
return result
......@@ -76,7 +76,7 @@ class MyParserImplementation1():
one example on how to avoid loading the entire file into memory.
"""
result = Result()
result.unit = ureg.newton
result.unit = "newton"
xyz_string = self.parser.get_file_contents("forces")
forces = []
i_forces = []
......@@ -127,7 +127,7 @@ class MyParserImplementation1():
yield np.array(i_forces)
result = Result()
result.unit = ureg.angstrom
result.unit = "angstrom"
result.value_iterable = position_generator()
return result
```
......@@ -149,7 +149,7 @@ class MyParserImplementation2(MyParserImplementation1):
def energy(self):
"""The energy unit has changed in this version."""
result = Result()
result.unit = ureg.hartree
result.unit = "hartree"
result.value = "2.0"
return result
```
......@@ -181,4 +181,4 @@ The 'files' object contains all the files that are given to the parser. The
attribute names are the file paths and their values are optional id's. The id's
are not typically given and they have to be assigned by using the
setup_file_id() function of NomadParser. Assigning id's helps to manage the
files.
files.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment