Skip to content

Commit

Permalink
remove manualy written type info from python docs
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-dupre committed Feb 3, 2025
1 parent b25cc0b commit b40f97c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 86 deletions.
65 changes: 22 additions & 43 deletions opening-hours-py/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,20 @@ fn validate(oh: &str) -> bool {
///
/// Parameters
/// ----------
/// oh : str
/// Opening hours expression as defined in OSM (eg. "24/7").
/// See https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification
/// timezone : Optional[zoneinfo.ZoneInfo]
/// Timezone where the physical place attached to these opening hours lives
/// in. When specified, operations on this expression will return dates
/// attached to this timezone and input times in other timezones will be
/// converted.
/// country : Optional[str]
/// ISO code of the country this physical place lives in. This will be used
/// to load a calendar of local public holidays.
/// coords : Optional[tuple[float, float]]
/// (latitude, longitude) of this place. When this is specified together
/// with a timezone sun events will be accurate (sunrise, sunset, dusk,
/// dawn). By default, this will be used to automatically detect the
/// timezone and a country code.
/// auto_country : bool (default: `True`)
/// If set to `True`, the country code will automatically be inferred from
/// coordinates when they are specified.
/// auto_timezone : bool (default: `True`)
/// If set to `True`, the timezone will automatically be inferred from
/// coordinates when they are specified.
/// - oh: Opening hours expression as defined in OSM (eg. "24/7"). See
/// https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification
/// - timezone: Timezone where the physical place attached to these opening hours lives in. When
/// specified, operations on this expression will return dates attached to this timezone and
/// input times in other timezones will be converted.
/// - country: ISO code of the country this physical place lives in. This will be used to load a
/// calendar of local public holidays.
/// - coords: (latitude, longitude) of this place. When this is specified together with a timezone
/// sun events will be accurate (sunrise, sunset, dusk, dawn). By default, this will be used to
/// automatically detect the timezone and a country code.
/// - auto_country: If set to `True`, the country code will automatically be inferred from
/// coordinates when they are specified.
/// - auto_timezone: If set to `True`, the timezone will automatically be inferred from coordinates
/// when they are specified.
///
/// Raises
/// ------
Expand Down Expand Up @@ -170,9 +162,7 @@ impl PyOpeningHours {
///
/// Parameters
/// ----------
/// time : Optional[datetime]
/// Base time for the evaluation, current time will be used if it is
/// not specified.
/// - time: Base time for the evaluation, current time will be used if it is not specified.
///
/// Examples
/// --------
Expand All @@ -188,9 +178,7 @@ impl PyOpeningHours {
///
/// Parameters
/// ----------
/// time : Optional[datetime]
/// Base time for the evaluation, current time will be used if it is
/// not specified.
/// - time: Base time for the evaluation, current time will be used if it is not specified.
///
/// Examples
/// --------
Expand All @@ -206,9 +194,7 @@ impl PyOpeningHours {
///
/// Parameters
/// ----------
/// time : Optional[datetime]
/// Base time for the evaluation, current time will be used if it is
/// not specified.
/// - time: Base time for the evaluation, current time will be used if it is not specified.
///
/// Examples
/// --------
Expand All @@ -224,9 +210,7 @@ impl PyOpeningHours {
///
/// Parameters
/// ----------
/// time : Optional[datetime]
/// Base time for the evaluation, current time will be used if it is
/// not specified.
/// - time: Base time for the evaluation, current time will be used if it is not specified.
///
/// Examples
/// --------
Expand All @@ -243,9 +227,7 @@ impl PyOpeningHours {
///
/// Parameters
/// ----------
/// time : Optional[datetime]
/// Base time for the evaluation, current time will be used if it is
/// not specified.
/// - time: Base time for the evaluation, current time will be used if it is not specified.
///
/// Examples
/// --------
Expand All @@ -266,12 +248,9 @@ impl PyOpeningHours {
///
/// Parameters
/// ----------
/// start: Optional[datetime]
/// Initial time for the iterator, current time will be used if it is
/// not specified.
/// end : Optional[datetime]
/// Maximal time for the iterator, the iterator will continue until
/// year 9999 if it no max is specified.
/// - start: Initial time for the iterator, current time will be used if it is not specified.
/// - end: Maximal time for the iterator, the iterator will continue until year 9999 if it no
/// max is specified.
///
/// Examples
/// --------
Expand Down
65 changes: 22 additions & 43 deletions opening_hours.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,20 @@ class OpeningHours:
Parameters
----------
oh : str
Opening hours expression as defined in OSM (eg. "24/7").
See https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification
timezone : Optional[zoneinfo.ZoneInfo]
Timezone where the physical place attached to these opening hours lives
in. When specified, operations on this expression will return dates
attached to this timezone and input times in other timezones will be
converted.
country : Optional[str]
ISO code of the country this physical place lives in. This will be used
to load a calendar of local public holidays.
coords : Optional[tuple[float, float]]
(latitude, longitude) of this place. When this is specified together
with a timezone sun events will be accurate (sunrise, sunset, dusk,
dawn). By default, this will be used to automatically detect the
timezone and a country code.
auto_country : bool (default: `True`)
If set to `True`, the country code will automatically be inferred from
coordinates when they are specified.
auto_timezone : bool (default: `True`)
If set to `True`, the timezone will automatically be inferred from
coordinates when they are specified.
- oh: Opening hours expression as defined in OSM (eg. "24/7"). See
https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification
- timezone: Timezone where the physical place attached to these opening hours lives in. When
specified, operations on this expression will return dates attached to this timezone and
input times in other timezones will be converted.
- country: ISO code of the country this physical place lives in. This will be used to load a
calendar of local public holidays.
- coords: (latitude, longitude) of this place. When this is specified together with a timezone
sun events will be accurate (sunrise, sunset, dusk, dawn). By default, this will be used to
automatically detect the timezone and a country code.
- auto_country: If set to `True`, the country code will automatically be inferred from
coordinates when they are specified.
- auto_timezone: If set to `True`, the timezone will automatically be inferred from coordinates
when they are specified.
Raises
------
Expand Down Expand Up @@ -68,9 +60,7 @@ class OpeningHours:
Parameters
----------
time : Optional[datetime]
Base time for the evaluation, current time will be used if it is
not specified.
- time: Base time for the evaluation, current time will be used if it is not specified.
Examples
--------
Expand All @@ -85,9 +75,7 @@ class OpeningHours:
Parameters
----------
time : Optional[datetime]
Base time for the evaluation, current time will be used if it is
not specified.
- time: Base time for the evaluation, current time will be used if it is not specified.
Examples
--------
Expand All @@ -104,9 +92,7 @@ class OpeningHours:
Parameters
----------
time : Optional[datetime]
Base time for the evaluation, current time will be used if it is
not specified.
- time: Base time for the evaluation, current time will be used if it is not specified.
Examples
--------
Expand All @@ -123,9 +109,7 @@ class OpeningHours:
Parameters
----------
time : Optional[datetime]
Base time for the evaluation, current time will be used if it is
not specified.
- time: Base time for the evaluation, current time will be used if it is not specified.
Examples
--------
Expand All @@ -143,9 +127,7 @@ class OpeningHours:
Parameters
----------
time : Optional[datetime]
Base time for the evaluation, current time will be used if it is
not specified.
- time: Base time for the evaluation, current time will be used if it is not specified.
Examples
--------
Expand All @@ -168,12 +150,9 @@ class OpeningHours:
Parameters
----------
start: Optional[datetime]
Initial time for the iterator, current time will be used if it is
not specified.
end : Optional[datetime]
Maximal time for the iterator, the iterator will continue until
year 9999 if it no max is specified.
- start: Initial time for the iterator, current time will be used if it is not specified.
- end: Maximal time for the iterator, the iterator will continue until year 9999 if it no
max is specified.
Examples
--------
Expand Down

0 comments on commit b40f97c

Please sign in to comment.