pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/theriftlab/immanuel-python/commit/62882446e0689f6bac29fe93084d1cbf186739b3

Optional params appended None type. · theriftlab/immanuel-python@6288244 · GitHub
Skip to content

Commit 6288244

Browse files
committed
Optional params appended None type.
1 parent 479e2b7 commit 6288244

File tree

8 files changed

+31
-31
lines changed

8 files changed

+31
-31
lines changed

immanuel/charts.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
class Subject:
3333
""" Simple class to model a chart subject - essentially just
3434
a time and place. """
35-
def __init__(self, date_time: str | float | datetime, latitude: float | list | tuple | str, longitude: float | list | tuple | str, timezone_offset: float = None, time_is_dst: bool = None) -> None:
35+
def __init__(self, date_time: str | float | datetime, latitude: float | list | tuple | str, longitude: float | list | tuple | str, timezone_offset: float | None = None, time_is_dst: bool | None = None) -> None:
3636
self.latitude, self.longitude = (convert.to_dec(v) for v in (latitude, longitude))
3737
self.time_is_dst = time_is_dst
3838
self.date_time = date.to_datetime(
@@ -159,7 +159,7 @@ def set_wrapped_weightings(self) -> None:
159159
class Natal(Chart):
160160
""" Standard natal chart generates data straight from the passed
161161
native information. """
162-
def __init__(self, native: Subject, aspects_to: Chart = None) -> None:
162+
def __init__(self, native: Subject, aspects_to: Chart | None = None) -> None:
163163
self._native = native
164164
super().__init__(chart.NATAL, aspects_to)
165165

@@ -196,7 +196,7 @@ def generate(self) -> None:
196196

197197
class SolarReturn(Chart):
198198
""" Solar return chart for the given year. """
199-
def __init__(self, native: Subject, year: int, aspects_to: Chart = None) -> None:
199+
def __init__(self, native: Subject, year: int, aspects_to: Chart | None = None) -> None:
200200
self._native = native
201201
self._solar_return_year = year
202202
super().__init__(chart.SOLAR_RETURN, aspects_to)
@@ -254,7 +254,7 @@ def set_wrapped_solar_return_date_time(self) -> None:
254254
class Progressed(Chart):
255255
""" Secondary progression chart uses the MC progression method from
256256
settings. """
257-
def __init__(self, native: Subject, date_time: datetime | str, aspects_to: Chart = None) -> None:
257+
def __init__(self, native: Subject, date_time: datetime | str, aspects_to: Chart | None = None) -> None:
258258
self._native = native
259259
self._date_time = date_time
260260
super().__init__(chart.PROGRESSED, aspects_to)
@@ -334,7 +334,7 @@ def set_wrapped_progression_method(self) -> None:
334334

335335
class Composite(Chart):
336336
""" Generates a midpoint chart based on the two passed sets of data. """
337-
def __init__(self, native: Subject, partner: Subject, aspects_to: Chart = None) -> None:
337+
def __init__(self, native: Subject, partner: Subject, aspects_to: Chart | None = None) -> None:
338338
self._native = native
339339
self._partner = partner
340340
super().__init__(chart.COMPOSITE, aspects_to)
@@ -450,7 +450,7 @@ def set_wrapped_partner(self):
450450
class Transits(Chart):
451451
""" Chart of the moment for the given coordinates. Structurally identical
452452
to the natal chart. Coordinates default to those specified in settings. """
453-
def __init__(self, latitude: float | list | tuple | str = settings.default_latitude, longitude: float | list | tuple | str = settings.default_longitude, aspects_to: Chart = None, houses_for_aspected: bool = False) -> None:
453+
def __init__(self, latitude: float | list | tuple | str = settings.default_latitude, longitude: float | list | tuple | str = settings.default_longitude, aspects_to: Chart | None = None, houses_for_aspected: bool = False) -> None:
454454
lat, lon = (convert.to_dec(v) for v in (latitude, longitude))
455455
timezone = date.timezone_name(lat, lon)
456456
date_time = datetime.now(tz=ZoneInfo(timezone))

immanuel/classes/localize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def reset() -> None:
5151
MAPPINGS = {}
5252

5353

54-
def localize(input: str, context: str = None) -> str:
54+
def localize(input: str, context: str | None = None) -> str:
5555
if Localize.translation is None:
5656
return input
5757

immanuel/classes/wrap.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __str__(self) -> str:
9494

9595

9696
class DateTime:
97-
def __init__(self, dt: datetime | float, armc: dict | float = None, latitude: float = None, longitude: float = None, time_is_dst: bool = None) -> None:
97+
def __init__(self, dt: datetime | float, armc: dict | float = None, latitude: float | None = None, longitude: float | None = None, time_is_dst: bool | None = None) -> None:
9898
self.datetime = date.to_datetime(dt, latitude, longitude)
9999
self.timezone = self.datetime.tzname()
100100
self.ambiguous = date.ambiguous(self.datetime) and time_is_dst is None
@@ -186,11 +186,11 @@ class Object:
186186
def __init__(
187187
self,
188188
object: dict,
189-
date_time: datetime = None,
190-
house: int = None,
191-
out_of_bounds: bool = None,
192-
in_sect: bool = None,
193-
dignity_state: dict = None,
189+
date_time: datetime | None = None,
190+
house: int | None = None,
191+
out_of_bounds: bool | None = None,
192+
in_sect: bool | None = None,
193+
dignity_state: dict | None = None,
194194
) -> None:
195195
self.index = object['index']
196196

immanuel/tools/calculate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def is_in_sect(object: dict, is_daytime: bool, sun: dict | float = None) -> bool
128128
return False
129129

130130

131-
def is_out_of_bounds(object: dict | float, jd: float = None, obliquity: float = None) -> bool:
131+
def is_out_of_bounds(object: dict | float, jd: float | None = None, obliquity: float | None = None) -> bool:
132132
""" Returns whether the passed object is out of bounds either on the passed
133133
Julian date or relative to the passed obliquity. """
134134
if isinstance(object, dict):

immanuel/tools/convert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def dec_to_dms(dec: float, round_to: tuple = ROUND_SECOND, pad_rounded: bool = F
4040
return dms + (0,) * (3-round_to[0]) if pad_rounded else dms
4141

4242

43-
def dms_to_string(dms: list | tuple, format: int = FORMAT_DMS, round_to: tuple = ROUND_SECOND, pad_rounded: bool = None) -> str:
43+
def dms_to_string(dms: list | tuple, format: int = FORMAT_DMS, round_to: tuple = ROUND_SECOND, pad_rounded: bool | None = None) -> str:
4444
""" Returns a D:M:S list as either a D:M:S, D°M'S" or
4545
lat/lon coordinate string. """
4646
pad_rounded = True if format in (FORMAT_LAT, FORMAT_LON) or (pad_rounded is None and format != FORMAT_DMS) else pad_rounded
@@ -66,7 +66,7 @@ def string_to_dms(string: str, round_to: tuple = ROUND_SECOND, pad_rounded: bool
6666
return dec_to_dms(string_to_dec(string), round_to, pad_rounded)
6767

6868

69-
def dec_to_string(dec: float, format: int = FORMAT_DMS, round_to: tuple = ROUND_SECOND, pad_rounded: bool = None) -> str:
69+
def dec_to_string(dec: float, format: int = FORMAT_DMS, round_to: tuple = ROUND_SECOND, pad_rounded: bool | None = None) -> str:
7070
""" Returns a decimal float as either a D:M:S or a D°M'S" string. """
7171
return dms_to_string(dec_to_dms(dec, round_to), format, round_to, pad_rounded)
7272

@@ -108,7 +108,7 @@ def to_dms(value: float | list | tuple | str, round_to: tuple = ROUND_SECOND, pa
108108
return None
109109

110110

111-
def to_string(value: float | list | tuple | str, format: int = FORMAT_DMS, round_to: tuple = ROUND_SECOND, pad_rounded: bool = None) -> str:
111+
def to_string(value: float | list | tuple | str, format: int = FORMAT_DMS, round_to: tuple = ROUND_SECOND, pad_rounded: bool | None = None) -> str:
112112
""" If the input type is unknown, this will guess and convert. """
113113
if isinstance(value, float):
114114
return dec_to_string(value, format, round_to, pad_rounded)

immanuel/tools/date.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ def get_timezone(lat: float, lon: float, offset: float) -> ZoneInfo | timezone:
4040
return ZoneInfo(timezone_name(lat, lon)) if offset is None else timezone(timedelta(hours=offset))
4141

4242

43-
def localize(dt: datetime, lat: float, lon: float, offset: float = None, is_dst: bool = None) -> datetime:
43+
def localize(dt: datetime, lat: float, lon: float, offset: float | None = None, is_dst: bool | None = None) -> datetime:
4444
""" Localizes a naive datetime based on either decimal lat/lon
4545
coordinates or an explicit UTC offset. """
4646
return dt.replace(tzinfo=get_timezone(lat, lon, offset), fold=1 if is_dst is False else 0)
4747

4848

49-
def to_datetime(dt: str | float | datetime, lat: float = None, lon: float = None, offset: float = None, is_dst: bool = None) -> datetime:
49+
def to_datetime(dt: str | float | datetime, lat: float | None = None, lon: float | None = None, offset: float | None = None, is_dst: bool | None = None) -> datetime:
5050
""" Convert an unknown into a datetime. Unknowns can be either an
5151
ISO-formatted string, a Julian Date, or already a datetime. """
5252
no_tz = (lat is None or lon is None) and offset is None
@@ -66,7 +66,7 @@ def to_datetime(dt: str | float | datetime, lat: float = None, lon: float = None
6666
return None
6767

6868

69-
def to_jd(dt: str | float | datetime, lat: float = None, lon: float = None, offset: float = None, is_dst: bool = None) -> float:
69+
def to_jd(dt: str | float | datetime, lat: float | None = None, lon: float | None = None, offset: float | None = None, is_dst: bool | None = None) -> float:
7070
""" Convert an unknown into a Julian date. Unknowns can be either an
7171
ISO-formatted string, already a Julian Date, or a datetime. """
7272
if isinstance(dt, float):

immanuel/tools/ephemeris.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
}
7878

7979

80-
def objects(object_list: tuple, jd: float, lat: float = None, lon: float = None, house_system: int = None, part_formula: int = None) -> dict:
80+
def objects(object_list: tuple, jd: float, lat: float | None = None, lon: float | None = None, house_system: int | None = None, part_formula: int | None = None) -> dict:
8181
""" Helper function returns a dict of all passed chart objects. """
8282
return _objects(
8383
object_list=object_list,
@@ -91,7 +91,7 @@ def objects(object_list: tuple, jd: float, lat: float = None, lon: float = None,
9191
)
9292

9393

94-
def armc_objects(object_list: tuple, jd: float, armc: float, lat: float = None, lon: float = None, obliquity: float = None, house_system: int = None, part_formula: int = None) -> dict:
94+
def armc_objects(object_list: tuple, jd: float, armc: float, lat: float | None = None, lon: float | None = None, obliquity: float | None = None, house_system: int | None = None, part_formula: int | None = None) -> dict:
9595
""" Helper function returns a dict of all passed chart objects
9696
with points & angles calculated from the passed ARMC. """
9797
return _objects(
@@ -106,7 +106,7 @@ def armc_objects(object_list: tuple, jd: float, armc: float, lat: float = None,
106106
)
107107

108108

109-
def get(index: int | str, jd: float, lat: float = None, lon: float = None, house_system: int = None, part_formula: int = None) -> dict:
109+
def get(index: int | str, jd: float, lat: float | None = None, lon: float | None = None, house_system: int | None = None, part_formula: int | None = None) -> dict:
110110
""" Helper function to retrieve an angle, house, planet, point,
111111
asteroid, or fixed star. """
112112
return _get(
@@ -121,7 +121,7 @@ def get(index: int | str, jd: float, lat: float = None, lon: float = None, house
121121
)
122122

123123

124-
def armc_get(index: int | str, jd: float, armc: float, lat: float = None, lon: float = None, obliquity: float = None, house_system: int = None, part_formula: int = None) -> dict:
124+
def armc_get(index: int | str, jd: float, armc: float, lat: float | None = None, lon: float | None = None, obliquity: float | None = None, house_system: int | None = None, part_formula: int | None = None) -> dict:
125125
""" Helper function to retrieve an angle, house, planet, point,
126126
asteroid, or fixed star with houses & angles calculated from the
127127
passed ARMC. """
@@ -245,7 +245,7 @@ def armc_house(index: int, armc: float, lat: float, obliquity: float, house_syst
245245
)
246246

247247

248-
def point(index: int, jd: float, lat: float = None, lon: float = None, house_system: int = None, part_formula: int = None) -> dict:
248+
def point(index: int, jd: float, lat: float | None = None, lon: float | None = None, house_system: int | None = None, part_formula: int | None = None) -> dict:
249249
""" Returns a calculated point by Julian date, and additionally by lat / lon
250250
coordinates. """
251251
return _point(
@@ -260,7 +260,7 @@ def point(index: int, jd: float, lat: float = None, lon: float = None, house_sys
260260
)
261261

262262

263-
def armc_point(index: int, jd: float, armc: float, lat: float, obliquity: float, house_system: int = None, part_formula: int = None) -> dict:
263+
def armc_point(index: int, jd: float, armc: float, lat: float, obliquity: float, house_system: int | None = None, part_formula: int | None = None) -> dict:
264264
""" Returns a calculated point by Julian date, and additionally by the
265265
passed ARMC. """
266266
return _point(
@@ -521,7 +521,7 @@ def _is_daytime(jd: float, lat: float, lon: float, armc: float, armc_obliquity:
521521

522522

523523
@cache
524-
def _angles_houses_vertex(jd: float, lat: float, lon: float, house_system: int, first_house_lon: float = None) -> dict:
524+
def _angles_houses_vertex(jd: float, lat: float, lon: float, house_system: int, first_house_lon: float | None = None) -> dict:
525525
""" Returns ecliptic longitudes for the houses, main angles, and the vertex,
526526
along with their speeds. Defaults to Placidus for main angles & vertex if
527527
an PLANET_ON_FIRST house system is chosen. Based on Julian date and
@@ -530,7 +530,7 @@ def _angles_houses_vertex(jd: float, lat: float, lon: float, house_system: int,
530530

531531

532532
@cache
533-
def _angles_houses_vertex_armc(armc: float, lat: float, obliquity: float, house_system: int, first_house_lon: float = None) -> dict:
533+
def _angles_houses_vertex_armc(armc: float, lat: float, obliquity: float, house_system: int, first_house_lon: float | None = None) -> dict:
534534
""" Returns ecliptic longitudes for the houses, main angles, and the vertex,
535535
along with their speeds. Defaults to Placidus for main angles & vertex if
536536
an PLANET_ON_FIRST house system is chosen. Based on ARMC, latitude and
@@ -637,7 +637,7 @@ def _syzygy(jd: float) -> dict:
637637

638638

639639
@cache
640-
def _part(index: int, jd: float, lat: float, lon: float, formula: int, armc: float = None, armc_obliquity: float = None) -> dict:
640+
def _part(index: int, jd: float, lat: float, lon: float, formula: int, armc: float | None = None, armc_obliquity: float | None = None) -> dict:
641641
""" Calculates Parts of Fortune, Spirit, and Eros. """
642642
sun = planet(chart.SUN, jd)
643643
moon = planet(chart.MOON, jd)

immanuel/tools/midpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from immanuel.tools import ephemeris
1616

1717

18-
def all(objects1: dict, objects2: dict, obliquity: float = None) -> dict:
18+
def all(objects1: dict, objects2: dict, obliquity: float | None = None) -> dict:
1919
""" Takes two dicts of chart objects typically returned by the ephemeris
2020
module and returns the averaged data for both sets as a third dict of
2121
composite objects. """
@@ -27,7 +27,7 @@ def all(objects1: dict, objects2: dict, obliquity: float = None) -> dict:
2727
return objects
2828

2929

30-
def composite(object1: dict, object2: dict, obliquity: float = None) -> dict:
30+
def composite(object1: dict, object2: dict, obliquity: float | None = None) -> dict:
3131
""" Given two chart objects typically returned by the ephemeris module,
3232
this function will return a composite object. """
3333
object = object1 | {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy