Skip to content

Commit

Permalink
Merge branch 'emoji'
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Jul 4, 2021
2 parents 7d84b0e + 5eb768e commit 683a8a7
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion pyinaturalist/models/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@define_model
class Comment(BaseModel):
"""An observation comment, based on the schema of comments
"""📝 An observation comment, based on the schema of comments
from `GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_.
"""

Expand Down
6 changes: 3 additions & 3 deletions pyinaturalist/models/controlled_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@define_model
class Annotation(BaseModel):
"""An annotation, meaning a **controlled term value** applied by a **user** to an **observation**.
"""📝 An annotation, meaning a **controlled term value** applied by a **user** to an **observation**.
Based on the schema of annotations from
`GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_.
"""
Expand Down Expand Up @@ -45,7 +45,7 @@ def __str__(self) -> str:

@define_model
class ControlledTermValue(BaseModel):
"""A controlled term **value**, based on the schema of
"""📋 A controlled term **value**, based on the schema of
`GET /controlled_terms <https://api.inaturalist.org/v1/docs/#!/Controlled_Terms/get_controlled_terms>`_.
"""

Expand All @@ -62,7 +62,7 @@ def __str__(self):

@define_model
class ControlledTerm(BaseModel):
"""A controlled term, based on the schema of
"""📋 A controlled term, based on the schema of
`GET /controlled_terms <https://api.inaturalist.org/v1/docs/#!/Controlled_Terms/get_controlled_terms>`_.
"""

Expand Down
2 changes: 1 addition & 1 deletion pyinaturalist/models/identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@define_model
class Identification(BaseModel):
"""An observation identification, based on the schema of
"""🔎 An observation identification, based on the schema of
`GET /identifications <https://api.inaturalist.org/v1/docs/#!/Identifications/get_identifications>`_.
"""

Expand Down
4 changes: 2 additions & 2 deletions pyinaturalist/models/life_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@define_model
class LifeListTaxon(TaxonCount):
"""A single taxon in a user's life list"""
"""🐦 A single :py:class:`.Taxon` in a user's :py:class:`.LifeList`"""

descendant_obs_count: int = field(default=0, doc='Number of observations of taxon children')
direct_obs_count: int = field(
Expand All @@ -33,7 +33,7 @@ def __str__(self) -> str:

@define_model_collection
class LifeList(TaxonCounts):
"""A user's life list, based on the schema of ``GET /observations/taxonomy``"""
"""🐦✅📓 A user's life list, based on the schema of ``GET /observations/taxonomy``"""

count_without_taxon: int = field(default=0)
data: List[LifeListTaxon] = field(factory=list, converter=LifeListTaxon.from_json_list) # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions pyinaturalist/models/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

@define(auto_attribs=False, init=False, field_transformer=add_lazy_attrs)
class Observation(BaseModel):
"""An observation, based the schema of
"""👤🔎🐦 An observation, based the schema of
`GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_.
"""

Expand Down Expand Up @@ -224,7 +224,7 @@ def __str__(self) -> str:

@define_model_collection
class Observations(BaseModelCollection):
"""A collection of observations"""
"""👥🔍🐦 A collection of observations"""

data: List[Observation] = field(factory=list, converter=Observation.from_json_list)

Expand Down
4 changes: 2 additions & 2 deletions pyinaturalist/models/observation_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

@define_model
class ObservationField(BaseModel):
"""An observation field **definition**, based on the schema of
"""📋 An observation field **definition**, based on the schema of
`GET /observation_fields <https://www.inaturalist.org/pages/api+reference#get-observation_fields>`_.
"""

Expand Down Expand Up @@ -59,7 +59,7 @@ def __str__(self) -> str:

@define_model
class ObservationFieldValue(BaseModel):
"""An observation field **value**, matching the schema of ``ofvs``
"""📝 An observation field **value**, based on the schema of ``Observation.ofvs``
from `GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_.
"""

Expand Down
6 changes: 4 additions & 2 deletions pyinaturalist/models/photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

@define_model
class Photo(BaseModel):
"""An observation photo, based on the schema of photos from
`GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_.
"""📷 An observation photo, based on the schema of photos from:
* `GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_
* `GET /taxa <https://api.inaturalist.org/v1/docs/#!/Taxa/get_taxa>`
"""

attribution: str = field(default=None, doc='License attribution')
Expand Down
2 changes: 1 addition & 1 deletion pyinaturalist/models/place.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def convert_optional_lat_long(obj: Union[Dict, List, None, str]):

@define_model
class Place(BaseModel):
"""A curated or community-contributed place. Handles data from the following endpoints:
"""📍 A curated or community-contributed place. Handles data from the following endpoints:
* `GET /places/{id} <https://api.inaturalist.org/v1/docs/#!/Places/get_places_id>`_
* `GET /places/nearby <https://api.inaturalist.org/v1/docs/#!/Places/get_places_nearby>`_
Expand Down
8 changes: 4 additions & 4 deletions pyinaturalist/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

@define_model
class ProjectObservation(BaseModel):
"""Metadata about an observation that has been added to a project"""
"""👤🔎🐦 Metadata about an observation that has been added to a project"""

preferences: Dict = field(factory=dict) # Example: {'allows_curator_coordinate_access': True}
project: Dict = field(factory=dict) # Example: {'id': 24237}
Expand All @@ -37,7 +37,7 @@ class ProjectObservation(BaseModel):

@define_model
class ProjectObservationField(ObservationField):
"""An :py:class:`.ObservationField` with additional project-specific information"""
"""📋 An :py:class:`.ObservationField` with additional project-specific information"""

project_observation_field_id: int = field(default=None)
position: int = field(default=None)
Expand All @@ -55,7 +55,7 @@ def from_json(cls, value: JsonResponse, **kwargs) -> 'ProjectObservationField':

@define_model
class ProjectUser(User):
"""A :py:class:`.User` with additional project-specific information"""
"""👤 A :py:class:`.User` with additional project-specific information"""

project_id: int = field(default=None)
project_user_id: int = field(default=None)
Expand All @@ -73,7 +73,7 @@ def from_json(cls, value: JsonResponse, **kwargs) -> 'ProjectUser':

@define_model
class Project(BaseModel):
"""A dataclass containing information about a project, matching the schema of
"""👥 An iNaturalist project, based on the schema of
`GET /projects <https://api.inaturalist.org/v1/docs/#!/Projects/get_projects>`_.
"""

Expand Down
2 changes: 1 addition & 1 deletion pyinaturalist/models/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@define_model
class SearchResult(BaseModel):
"""A dataclass for search results, matching the schema of
"""🔍 A search result of any type, based on the schema of
`GET /search <https://api.inaturalist.org/v1/docs/#!/Search/get_search>`_.
"""

Expand Down
16 changes: 9 additions & 7 deletions pyinaturalist/models/taxon.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
# TODO: Include codes from other sources? Currently only including IUCN codes.
@define_model
class ConservationStatus(BaseModel):
"""The conservation status of a taxon in a given location, based on the schema of:
"""‼️ The conservation status of a taxon in a given location, based on the schema of:
* Taxon.conservation_status from `GET /taxa <https://api.inaturalist.org/v1/docs/#!/Taxa/get_taxa>`_
* Observation.taxon.conservation_statused from `GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_
* ``Taxon.conservation_status`` from `GET /taxa <https://api.inaturalist.org/v1/docs/#!/Taxa/get_taxa>`_
* ``Observation.taxon.conservation_statuses`` from `GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_
"""

authority: str = field(default=None, doc='Data source for conservation status')
Expand Down Expand Up @@ -74,7 +74,7 @@ class ConservationStatus(BaseModel):

@define_model
class EstablishmentMeans(BaseModel):
"""The establishment means for a taxon in a given location"""
"""‼️ The establishment means for a taxon in a given location"""

establishment_means: str = field(
default=None, options=ESTABLISTMENT_MEANS, doc='Establishment means description'
Expand All @@ -89,7 +89,7 @@ def __str__(self) -> str:

@define_model
class Taxon(BaseModel):
"""An iNaturalist taxon, based on the schema of
"""🐦 An iNaturalist taxon, based on the schema of
`GET /taxa <https://api.inaturalist.org/v1/docs/#!/Taxa/get_taxa>`_.
Can be constructed from either a full or partial JSON record. Examples of partial records
Expand Down Expand Up @@ -268,7 +268,9 @@ def __str__(self) -> str:

@define_model
class TaxonCount(Taxon):
"""A taxon with an associated count, used in a :py:class:`.TaxonCounts` collection"""
"""🐦#️⃣ A :py:class:`.Taxon` with an associated count, used in a :py:class:`.TaxonCounts`
collection
"""

count: int = field(default=0, doc='Number of observations of this taxon')

Expand Down Expand Up @@ -296,7 +298,7 @@ def __str__(self) -> str:

@define_model_collection
class TaxonCounts(BaseModelCollection):
"""A collection of taxa with an associated counts. Used with
"""🐦#️⃣📓 A collection of taxa with an associated counts. Used with
`GET /observations/species_counts <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations_species_counts>`_.
as well as :py:class:`.LifeList`.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyinaturalist/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@define_model
class User(BaseModel):
"""A dataclass containing information about an user, matching the schema of
"""👤 An iNaturalist user, based on the schema of
`GET /users/{id} <https://api.inaturalist.org/v1/docs/#!/Users/get_users_id>`_.
"""

Expand Down

0 comments on commit 683a8a7

Please sign in to comment.