Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unitless unit and fixed data not plottable for eccentricity jobs #379

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MDANSE/Src/MDANSE/Framework/Jobs/Eccentricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def initialize(self):
"LineOutputVariable",
npoints,
axis="time",
units="uma*nm2",
units="uma nm2",
)
for axis in ["a", "b", "c"]:
self._outputData.add(
Expand Down
5 changes: 3 additions & 2 deletions MDANSE/Src/MDANSE/Framework/Units.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,12 +692,13 @@ def load(self):
UnitsManager._UNITS.clear()

d = {}
with open(UnitsManager._DEFAULT_DATABASE, "r") as fin:
d.update(json.load(fin))
try:
with open(UnitsManager._USER_DATABASE, "r") as fin:
d.update(json.load(fin))
except:
with open(UnitsManager._DEFAULT_DATABASE, "r") as fin:
d.update(json.load(fin))
self.save()
finally:
for uname, udict in list(d.items()):
factor = udict.get("factor", 1.0)
Expand Down
16 changes: 15 additions & 1 deletion MDANSE/Src/MDANSE/Framework/units.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,21 @@
0
],
"factor": 1.0
},
},
"unitless": {
"dimension": [
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"factor": 1.0
},
"au": {
"dimension": [
0,
Expand Down
Loading