aetherfield 0.2.7__tar.gz → 0.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aetherfield
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: AetherField runtime ephemeris
5
5
  Author: WitchMithras
6
6
  License: Other/Proprietary License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aetherfield"
7
- version = "0.2.7"
7
+ version = "0.2.8"
8
8
  description = "AetherField runtime ephemeris"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -34,12 +34,16 @@ SIGNS = [
34
34
  "Virgo", "Libra", "Scorpio", "Sagittarius",
35
35
  "Capricorn", "Aquarius", "Pisces"
36
36
  ]
37
+ data = None
37
38
 
38
39
  AGE_LENGTH = 2147.67
39
40
 
40
41
  ANCHOR_YEAR = 1
41
42
  ANCHOR_SIGN = "Pisces"
42
43
 
44
+ CACHE_PATH = os.path.join(os.path.expanduser("~"), ".cache", "aetherfield", "aetherfield_calibration.json")
45
+ REMOTE_URL = "https://pythoness.duckdns.org/v1/aether/calibration/file"
46
+
43
47
  load_dotenv()
44
48
 
45
49
  def _wrap_deg(x: float) -> float:
@@ -218,13 +222,13 @@ except Exception:
218
222
  return signs[i]
219
223
 
220
224
 
221
- DE421_START = datetime(1951, 1, 1, tzinfo=UTC)
222
- DE421_END = datetime(2050, 12, 31, 23, 59, 59, tzinfo=UTC)
223
- DE440_START = datetime(1550, 1, 1, tzinfo=UTC)
224
- DE440_END = datetime(2650, 12, 31, 23, 59, 59, tzinfo=UTC)
225
+ DE421_START = datetime(1951, 1, 2, tzinfo=UTC)
226
+ DE421_END = datetime(2049, 12, 30, 23, 59, 58, tzinfo=UTC)
227
+ DE440_START = datetime(1551, 1, 2, tzinfo=UTC)
228
+ DE440_END = datetime(2649, 12, 30, 23, 59, 58, tzinfo=UTC)
225
229
  # DE441 spans beyond Python's datetime range; clamp to supported bounds.
226
- DE441_START = datetime(1, 1, 1, tzinfo=UTC)
227
- DE441_END = datetime(9999, 12, 31, 23, 59, 59, tzinfo=UTC)
230
+ DE441_START = datetime(1, 1, 2, tzinfo=UTC)
231
+ DE441_END = datetime(9999, 12, 30, 23, 59, 58, tzinfo=UTC)
228
232
 
229
233
 
230
234
  @dataclass(frozen=True)
@@ -243,23 +247,23 @@ EPHEMERIS_SPECS: Dict[str, EphemerisSpec] = {
243
247
  start=DE421_START,
244
248
  end=DE421_END,
245
249
  true_start_year=1951,
246
- true_end_year=2050,
250
+ true_end_year=2049,
247
251
  ),
248
252
  "de440": EphemerisSpec(
249
253
  name="de440",
250
254
  filename="de440.bsp",
251
255
  start=DE440_START,
252
256
  end=DE440_END,
253
- true_start_year=1550,
254
- true_end_year=2650,
257
+ true_start_year=1551,
258
+ true_end_year=2649,
255
259
  ),
256
260
  "de441": EphemerisSpec(
257
261
  name="de441",
258
262
  filename="de441.bsp",
259
263
  start=DE441_START,
260
264
  end=DE441_END,
261
- true_start_year=-13200,
262
- true_end_year=17191,
265
+ true_start_year=-13201,
266
+ true_end_year=17189,
263
267
  ),
264
268
  }
265
269
  EPHEMERIS_PREFERENCE = ("de441", "de440", "de421")
@@ -316,9 +320,9 @@ def _select_calibration_ephemeris() -> Tuple[EphemerisSpec, Optional[Path]]:
316
320
  return EPHEMERIS_SPECS["de421"], _resolve_ephemeris_path("de421.bsp")
317
321
 
318
322
  def resolve_ephemeris(year: int):
319
- if 1950 <= year <= 2050:
323
+ if 1951 <= year <= 2049:
320
324
  return "de421"
321
- elif 1550 <= year <= 2650:
325
+ elif 1551 <= year <= 2649:
322
326
  return "de440"
323
327
  else:
324
328
  return "de441"
@@ -387,6 +391,8 @@ PHASE_NAMES = [
387
391
  ]
388
392
 
389
393
  def _resolve_cal_path(path: str) -> Path:
394
+ if path == 'AetherField':
395
+ return path
390
396
  p = Path(path)
391
397
  if p.is_file():
392
398
  return p
@@ -962,11 +968,10 @@ class AetherField:
962
968
 
963
969
  @classmethod
964
970
  def load_calibration(cls, path: str) -> 'AetherField':
971
+ global data
965
972
  """Load rates, anchors, and piecewise segments from a JSON file."""
966
- if not os.getenv("AETHER_CAL_FILE", False):
967
- CACHE_PATH = os.path.join(os.path.expanduser("~"), ".cache", "aetherfield", "aetherfield_calibration.json")
968
- REMOTE_URL = "https://pythoness.duckdns.org/v1/aether/calibration/file"
969
- data = None
973
+ if path == 'AetherField':
974
+
970
975
  if not data:
971
976
  # 2. Remote fetch
972
977
  try:
@@ -1042,7 +1047,7 @@ _GLOBAL_AETHER = AetherField()
1042
1047
  _CAL_LOADED = False
1043
1048
  if not _CAL_LOADED:
1044
1049
  # allow override via env var if you want
1045
- cal_path = os.getenv("AETHER_CAL_FILE", "aetherfield_calibration.json")
1050
+ cal_path = os.getenv("AETHER_CAL_FILE", 'AetherField')
1046
1051
  _GLOBAL_AETHER = AetherField.load_calibration(str(_resolve_cal_path(cal_path)))
1047
1052
  _CAL_LOADED = True
1048
1053
 
@@ -1050,7 +1055,7 @@ def aether_alignments(dt: Optional[Any] = None) -> Dict[str, str]:
1050
1055
  global _GLOBAL_AETHER, _CAL_LOADED
1051
1056
  if not _CAL_LOADED:
1052
1057
  # allow override via env var if you want
1053
- cal_path = os.getenv('AETHER_CAL_FILE', 'aetherfield_calibration.json')
1058
+ cal_path = os.getenv('AETHER_CAL_FILE', 'AetherField')
1054
1059
  _GLOBAL_AETHER = AetherField.load_calibration(str(_resolve_cal_path(cal_path)))
1055
1060
  _CAL_LOADED = True
1056
1061
 
@@ -1103,7 +1108,7 @@ def aether_longitude(dt: Any, body: str) -> float:
1103
1108
  global _GLOBAL_AETHER, _CAL_LOADED
1104
1109
  if not _CAL_LOADED:
1105
1110
  # allow override via env var if you want
1106
- cal_path = os.getenv("AETHER_CAL_FILE", "aetherfield_calibration.json")
1111
+ cal_path = os.getenv("AETHER_CAL_FILE", 'AetherField')
1107
1112
  _GLOBAL_AETHER = AetherField.load_calibration(str(_resolve_cal_path(cal_path)))
1108
1113
  _CAL_LOADED = True
1109
1114
 
@@ -1114,7 +1119,7 @@ def aether_sign(dt: Any, body: str) -> str:
1114
1119
  global _GLOBAL_AETHER, _CAL_LOADED
1115
1120
  if not _CAL_LOADED:
1116
1121
  # allow override via env var if you want
1117
- cal_path = os.getenv("AETHER_CAL_FILE", "aetherfield_calibration.json")
1122
+ cal_path = os.getenv("AETHER_CAL_FILE", 'AetherField')
1118
1123
  _GLOBAL_AETHER = AetherField.load_calibration(str(_resolve_cal_path(cal_path)))
1119
1124
  _CAL_LOADED = True
1120
1125
 
@@ -1140,7 +1145,7 @@ def aetherium_longitude_mt(mt: Any, body: str) -> float:
1140
1145
 
1141
1146
  if not _CAL_LOADED:
1142
1147
  # allow override via env var if you want
1143
- cal_path = os.getenv("AETHER_CAL_FILE", "aetherfield_calibration.json")
1148
+ cal_path = os.getenv("AETHER_CAL_FILE", 'AetherField')
1144
1149
  _GLOBAL_AETHER = AetherField.load_calibration(str(_resolve_cal_path(cal_path)))
1145
1150
  _CAL_LOADED = True
1146
1151
 
@@ -1162,7 +1167,7 @@ def moon_phase(dt: Any):
1162
1167
 
1163
1168
  if not _CAL_LOADED:
1164
1169
  # allow override via env var if you want
1165
- cal_path = os.getenv("AETHER_CAL_FILE", "aetherfield_calibration.json")
1170
+ cal_path = os.getenv("AETHER_CAL_FILE", 'AetherField')
1166
1171
  _GLOBAL_AETHER = AetherField.load_calibration(str(_resolve_cal_path(cal_path)))
1167
1172
  _CAL_LOADED = True
1168
1173
 
@@ -1302,7 +1307,7 @@ def ae_is_up(dt, body: str, coords: (float, float) = None, method: str = "full",
1302
1307
 
1303
1308
  if not _CAL_LOADED:
1304
1309
  # allow override via env var if you want
1305
- cal_path = os.getenv("AETHER_CAL_FILE", "aetherfield_calibration.json")
1310
+ cal_path = os.getenv("AETHER_CAL_FILE", 'AetherField')
1306
1311
  _GLOBAL_AETHER = AetherField.load_calibration(str(_resolve_cal_path(cal_path)))
1307
1312
  _CAL_LOADED = True
1308
1313
  lat_deg, lon_deg = map(float, coords.split(','))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aetherfield
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: AetherField runtime ephemeris
5
5
  Author: WitchMithras
6
6
  License: Other/Proprietary License
File without changes
File without changes
File without changes