Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CxoTime custom fast parser, use astropy built-in #34

Merged
merged 3 commits into from
Apr 5, 2023

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Jan 2, 2023

Description

The CxoTime fast C parser was the prototype for astropy. That fast parser is now built in to astropy so there is no need for the custom version in cxotime.

Interface impacts

None

Testing

Unit tests

  • Mac

Independent check of unit tests by Jean

  • Linux
  • Mac

Functional tests

In the local unit test, I did git clean -fxd to ensure no lingering binary files were accidentally allowing things to work.

@@ -486,7 +364,7 @@ class TimeSecs(TimeCxcSec):
name = "secs"


class TimeDate(TimeYearDayTime, FastDateParserMixin):
class TimeDate(TimeYearDayTime):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense and seems fine. I note that I'm not immediately lear on how to initialize the astropy time classes, as the docstring doesn't seem to address the items in the init signature. But that's not a cxotime issue.

Init signature:
TimeYearDayTime(
    val1,
    val2,
    scale,
    precision,
    in_subfmt,
    out_subfmt,
    from_jd=False,
)
Docstring:     
Year, day-of-year and time as "YYYY:DOY:HH:MM:SS.sss...".
The day-of-year (DOY) goes from 001 to 365 (366 in leap years).
For example, 2000:001:00:00:00.000 is midnight on January 1, 2000.

The allowed subformats are:

- 'date_hms': date + hours, mins, secs (and optional fractional secs)
- 'date_hm': date + hours, mins
- 'date': date

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These TimeFormat subclasses are defining a contained object within the Time class which is not directly set by the user. The Time class is defined in astropy/time/core.py.

Copy link
Contributor

@jeanconn jeanconn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good and makes sense to me. One issue is that it is difficult to see if the astropy built-in is in any way different from the custom fast parser. I think that just means we should keep an eye on the integration tests in this case.

@taldcroft taldcroft merged commit c3855a9 into master Apr 5, 2023
@taldcroft taldcroft deleted the remove-cxotime-fast-parser branch April 5, 2023 18:48
@javierggt javierggt mentioned this pull request Jul 12, 2023
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.

3 participants