Skip to content

Commit

Permalink
Add units to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherMayes committed Oct 23, 2024
1 parent 923467c commit ec4b574
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pmd_beamphysics/fields/fieldmesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _create_delta_property(name):
def getter(self):
return self.deltas[self.axis_index(name)]

return property(getter, doc=f"Mesh spacing in {name}")
return property(getter, doc=f"Mesh spacing in {name} in units of {pg_units(name)}")


def _create_max_property(name):
Expand All @@ -79,7 +79,9 @@ def setter(self, value):
self.attrs["gridOriginOffset"] = tuple(mins)

return property(
getter, setter, doc=f"Mesh maximum in {name}. This can also be set."
getter,
setter,
doc=f"Mesh maximum in {name} in units of {pg_units(name)}. This can also be set.",
)


Expand All @@ -93,15 +95,19 @@ def setter(self, value):
self.attrs["gridOriginOffset"] = tuple(mins)

return property(
getter, setter, doc=f"Mesh minimim in {name}. This can also be set."
getter,
setter,
doc=f"Mesh minimim in {name} in units of {pg_units(name)}. This can also be set.",
)


def _create_scaled_component_property(name):
def getter(self):
return self.scaled_component(name)

return property(getter, doc=f"Scaled 3D mesh for {name} in {pg_units(name)}")
return property(
getter, doc=f"Scaled 3D mesh for {name} in units of {pg_units(name)}"
)


class FieldMesh:
Expand Down

0 comments on commit ec4b574

Please sign in to comment.