Skip to content

Downloaded SW file is not refreshed if it is out of date #69

Description

@mananapr

The package automatically downloads SW-All file from Celestrak in case it is not present in the package directory. However, it won't refresh the downloaded file in case an updated version is present on Celestrak.

The existing condition can be updated as follows -

def _load_f107_ap_data() -> dict[str, npt.NDArray]:
    """Load data from disk, if it isn't present go out and download it first."""
    if not _F107_AP_PATH.exists() or datetime.datetime.now() > datetime.datetime.fromtimestamp(os.path.getmtime(_F107_AP_PATH)) + datetime.timedelta(days=1):
        download_f107_ap()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions