Skip to content

set_datetime fails within convert_latlon_arr #97

@alexchartier

Description

@alexchartier

Describe the bug

Several routines (convert_latlon(), convert_latlon_arr(), likely others) fail on a recent Apple M2 laptop due to c_aacgmv2.set_datetime failing. The issue was present both with pip and commandline install.

To Reproduce
% python3
Python 3.9.6 (default, Apr 30 2025, 02:07:17)
[Clang 17.0.0 (clang-1700.0.13.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import aacgmv2
import datetime as dt
aacgmv2.convert_latlon_arr(0, 0, 100, dt.datetime(2005, 1, 1))
Traceback (most recent call last):
File "/Users/chartat1/Library/Python/3.9/lib/python/site-packages/aacgmv2/wrapper.py", line 379, in convert_latlon_arr
c_aacgmv2.set_datetime(dtime.year, dtime.month, dtime.day, dtime.hour,
RuntimeError: AACGM_v2_SetDateTime returned error code -1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/Users/chartat1/Library/Python/3.9/lib/python/site-packages/aacgmv2/wrapper.py", line 382, in convert_latlon_arr
raise RuntimeError("cannot set time for {:}: {:}".format(dtime, err))
RuntimeError: cannot set time for 2005-01-01 00:00:00: AACGM_v2_SetDateTime returned error code -1

Desktop (please complete the following information):

  • OS: MacOS Sequoia
  • Version 15.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions