소스 검색

feat: use Skyfield-Data library instead of downloading needed files at first time (#22)

The folder created automatically at `~/.kosmorro-cache` is not needed
anymore and can be deleted safely.
tags/v1.0.0
Jérôme Deuchnord 3 년 전
committed by Jérôme Deuchnord
부모
커밋
50b9569e5e
No known key found for this signature in database GPG 키 ID: 9F72B1EF93EDE1D4
2개의 변경된 파일5개의 추가작업 그리고 13개의 파일을 삭제
  1. +1
    -0
      Pipfile
  2. +4
    -13
      kosmorrolib/core.py

+ 1
- 0
Pipfile 파일 보기

@@ -13,6 +13,7 @@ coverage = "*"
skyfield = ">=1.32.0,<2.0.0"
numpy = ">=1.17.0,<2.0.0"
python-dateutil = ">=2.8.0,<3.0.0"
skyfield-data = ">=3.0.0,<4.0.0"

[requires]
python_version = "3"

+ 4
- 13
kosmorrolib/core.py 파일 보기

@@ -1,35 +1,26 @@
#!/usr/bin/env python3

from shutil import rmtree
from pathlib import Path

from skyfield.api import Loader
from skyfield.timelib import Time
from skyfield.nutationlib import iau2000b

CACHE_FOLDER = str(Path.home()) + "/.kosmorro-cache"

from skyfield_data import get_skyfield_data_path

def get_loader():
return Loader(CACHE_FOLDER)
LOADER = Loader(get_skyfield_data_path())


def get_timescale():
return get_loader().timescale()
return LOADER.timescale()


def get_skf_objects():
return get_loader()("de421.bsp")
return LOADER("de421.bsp")


def get_iau2000b(time: Time):
return iau2000b(time.tt)


def clear_cache():
rmtree(CACHE_FOLDER)


def flatten_list(the_list: list):
new_list = []
for item in the_list:


불러오는 중...
취소
저장