Skip to content

Commit

Permalink
Merge pull request #1217 from AllenNeuralDynamics/1184-20-remove-all-…
Browse files Browse the repository at this point in the history
…uses-of-xvalue-create_unit_with_value

feat: remove references to PowerValue
  • Loading branch information
dbirman authored Jan 9, 2025
2 parents 9b22a2d + 054f2e5 commit 9e4bde4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
12 changes: 4 additions & 8 deletions examples/exaspim_acquisition.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@
"device_name": "Laser_1",
"description": "Laser power calibration",
"input": {
"power_setting": {
"value": "100.0",
"unit": "percent"
}
"power_setting": 100.0,
"power_unit": "percent"
},
"output": {
"power_measurement": {
"value": "50.0",
"unit": "milliwatt"
}
"power_measurement": 50.0,
"power_unit": "milliwatt"
},
"notes": null
}
Expand Down
12 changes: 9 additions & 3 deletions examples/exaspim_acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from aind_data_schema_models.organizations import Organization
from aind_data_schema_models.pid_names import PIDName
from aind_data_schema_models.registries import Registry
from aind_data_schema_models.units import PowerValue
from aind_data_schema_models.units import PowerUnit

from aind_data_schema.components import tile
from aind_data_schema.components.coordinates import ImageAxis, Scale3dTransform, Translation3dTransform
Expand Down Expand Up @@ -44,8 +44,14 @@
calibration_date=t,
device_name="Laser_1",
description="Laser power calibration",
input={"power_setting": PowerValue(value=100.0, unit="percent")},
output={"power_measurement": PowerValue(value=50.0, unit="milliwatt")},
input={
"power_setting": 100.0,
"power_unit": PowerUnit.PERCENT
},
output={
"power_measurement": 50.0,
"power_unit": PowerUnit.MW,
},
)
],
session_start_time=t,
Expand Down
22 changes: 17 additions & 5 deletions tests/test_imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import date, datetime, timezone

from aind_data_schema_models.organizations import Organization
from aind_data_schema_models.units import PowerValue, FrequencyUnit
from aind_data_schema_models.units import PowerUnit, FrequencyUnit
from pydantic import ValidationError
from pydantic import __version__ as pyd_version

Expand Down Expand Up @@ -43,8 +43,14 @@ def test_constructors(self):
calibration_date=datetime.now(tz=timezone.utc),
description="Laser power calibration",
device_name="Laser 1",
input={"power_setting": PowerValue(value=100.0, unit="percent")},
output={"power_measurement": PowerValue(value=50.0, unit="milliwatt")},
input={
"power_setting": 100.0,
"power_unit": PowerUnit.PERCENT
},
output={
"power_measurement": 50.0,
"power_unit": PowerUnit.MW,
},
),
],
session_end_time=datetime.now(tz=timezone.utc),
Expand Down Expand Up @@ -144,8 +150,14 @@ def test_axis(self):
calibration_date=datetime.now(tz=timezone.utc),
description="Laser power calibration",
device_name="Laser 1",
input={"power_setting": PowerValue(value=100.0, unit="percent")},
output={"power_measurement": PowerValue(value=50.0, unit="milliwatt")},
input={
"power_setting": 100.0,
"power_unit": PowerUnit.PERCENT
},
output={
"power_measurement": 50.0,
"power_unit": PowerUnit.MW,
},
),
],
session_end_time=datetime.now(tz=timezone.utc),
Expand Down

0 comments on commit 9e4bde4

Please sign in to comment.