Skip to content

Commit

Permalink
Try to improve class docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mwcraig committed Feb 4, 2024
1 parent cea6076 commit de56a31
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions stellarphot/settings/astropy_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ def __get_pydantic_core_schema__(
@dataclass
class EquivalentTo:
"""
This class is a pydantic "marker" (their word for this kind of thing) that
can be used to annotate fields that should be equivalent to a given unit.
This can be used to annotate pydantic fields where the value should have a unit
that is convertible to a given unit.
Parameters
----------
Expand Down Expand Up @@ -263,8 +263,8 @@ def __hash__(self):
@dataclass
class WithPhysicalType:
"""
This class is a pydantic "marker" (their word for this kind of thing) that
can be used to annotate fields that should be of a specific physical type.
This class can be used to annotate pydantic fields whose value
should be of a specific physical type.
Parameters
----------
Expand Down Expand Up @@ -360,7 +360,8 @@ def serialize_astropy_type(value):
In principle, we ought to be able to use the astropy serialization stuff
that is used in writing tables to ecsv here, but that is not quite working
yet.
as of January 2024, so for now we fall back to a string representation when
the value is a Unit or Quantity.
Parameters
----------
Expand Down Expand Up @@ -407,9 +408,8 @@ def dict_rep(instance):

class AstropyValidator:
"""
This class is a pydantic "marker" (their word for this kind of thing) that
can be used to annotate fields that should be of an astropy type that can be
serialized.
This class can be used to annotate pydantic fields that are an astropy type
(e.g. SkyCoord) to add basic pydantic validation and serialization.
Examples
--------
Expand Down

0 comments on commit de56a31

Please sign in to comment.