aburrell / apexpy

A Python wrapper for Apex coordinates
MIT License
34 stars 25 forks source link

Improve testing for apex.dat #112

Closed aburrell closed 1 year ago

aburrell commented 1 year ago

Description

The IGRF data in apex.dat needs to be updated every 5 years. To ensure this is done, I added a unit test for initializing an Apex object with today's date (this will fail if the IGRF data in apex.dat is too old) and added a cron job to run every Monday. Installation instructions are also improved, following issue #110. Addresses #111.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

If the current date is bad (e.g., more than 5 years since the IGRF update), the fortran code will put out an error

import apexpy
import datetime as dt

stime = dt.datetime(2034, 1, 1)
apex = apexpy.Apex(date=stime)

In ipython, this will crash with the error: COFRM: DATE 2034.0 is after the last recommended for extrapolation 1905.0. This isn't an exception that is caught by Python, so we don't test for it in the unit tests. We only check for its failure to know when apex.dat needs to be updated.

Test Configuration

Checklist

aburrell commented 1 year ago

Bug captured in #113