Skip to content

Handle recarrays for automatically generated tests in a single place - #318

Merged
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:recarrays-in-tests
Aug 15, 2026
Merged

Handle recarrays for automatically generated tests in a single place#318
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:recarrays-in-tests

Conversation

@eerovaher

Copy link
Copy Markdown
Collaborator

In some of the tests created by erfa_generator arrays should be viewed as recarrays so that data in them could be accessed by named attributes. On current main creating the recarrays is handled in two different TestFunction methods, but in this PR it is done in just one. There are two small changes to the generated test_ufunc.py file:

421c421
<     astrom = np.zeros((), erfa_ufunc.dt_eraASTROM).view(np.recarray)
---
>     astrom = np.empty((), erfa_ufunc.dt_eraASTROM).view(np.recarray)
430c430
<     astrom = np.zeros((), erfa_ufunc.dt_eraASTROM).view(np.recarray)
---
>     astrom = np.empty((), erfa_ufunc.dt_eraASTROM).view(np.recarray)

The changes are in the test_aper() and test_aper13() functions. From what I can tell in both cases the new versions of the generated tests are more similar to the ERFA C tests than the old versions.

In some of the tests created by `erfa_generator` arrays should be viewed
as recarrays so that data in them could be accessed by named attributes.
So far creating the recarrays has been handled in two different
`TestFunction` methods, but now it is done in just one.
@avalentino
avalentino merged commit 676d157 into liberfa:main Aug 15, 2026
27 checks passed
@eerovaher
eerovaher deleted the recarrays-in-tests branch August 17, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants