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

Change Pulsar to run if user has PINT, but not libstempo #183

Open
Hazboun6 opened this issue May 16, 2019 · 1 comment
Open

Change Pulsar to run if user has PINT, but not libstempo #183

Hazboun6 opened this issue May 16, 2019 · 1 comment
Assignees

Comments

@Hazboun6
Copy link
Member

Hazboun6 commented May 16, 2019

Currently the user gets a printed message that says 'ERROR: Must have libstempo package installed!' if the import call for libstempo raises an ImportError exception. There are a number of user types who do need libstempo installed, including those dealing with gamma-ray or x-ray timing data, since libstempo (really TEMPO2) can't deal with these types of TOAs.

It looks like the only change to the working code would need to be here and would just be changing:

    if pint:
        toas = list(filter(lambda x: isinstance(x, toa.TOAs), args))
        model = list(filter(lambda x: isinstance(x, TimingModel), args))

    t2pulsar = list(filter(lambda x: isinstance(x, t2.tempopulsar), args))

to

    if pint:
        toas = list(filter(lambda x: isinstance(x, toa.TOAs), args))
        model = list(filter(lambda x: isinstance(x, TimingModel), args))
    if tempo2:
        t2pulsar = list(filter(lambda x: isinstance(x, t2.tempopulsar), args))

Besides that we'd just add a truthful error message. Something like: raise ValueError('Must have either PINT or libstempo installed.')

Does anyone (@vallis @paulthebaker @stevertaylor ) know of other places in the code that might require libstempo/TEMPO2?

@paulthebaker
Copy link
Member

This is a good idea. You should also change the import behavior to give warnings if either is missing.

I don't think PINT or libstempo is used outside of loading Pulsar objects.

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

No branches or pull requests

2 participants