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

TST: specialized OMNI HRO routines need testing #34

Closed
5 tasks done
jklenzing opened this issue Jan 26, 2021 · 7 comments · Fixed by #205
Closed
5 tasks done

TST: specialized OMNI HRO routines need testing #34

jklenzing opened this issue Jan 26, 2021 · 7 comments · Fixed by #205
Milestone

Comments

@jklenzing
Copy link
Member

jklenzing commented Jan 26, 2021

  • time_shift_to_magnetic_poles
  • calculate_imf_steadiness (w/ custom max_wnum)
  • Custom warning in calculate_imf_steadiness
  • calculate_dayside_reconnection
  • calculate_clock_angle
@jklenzing jklenzing added this to the 0.1.0 Release milestone Jan 26, 2021
@jklenzing
Copy link
Member Author

Need to evaluate the usage of these routines before writing tests

@jklenzing
Copy link
Member Author

Notes on usage of calculate_imf_steadiness. In pysatNASA 0.0.2, this will autofill a sample rate of 1 if a tag of '' is attached to the instrument. This allows the routine to be run on simulated data attached to a pysat_testing object. The usage of this should be evaluated in the tests.

@aburrell aburrell mentioned this issue Jun 30, 2022
12 tasks
@jklenzing
Copy link
Member Author

@aburrell, do we want to maintain support for older scipy?

except TypeError:
pysat.logger.warn(' '.join(['To automatically remove NaNs from the',
'calculation, please upgrade to scipy 1.4',
'or newer.']))
circ_kwargs.pop('nan_policy')
ca_std = \
inst['clock_angle'].rolling(min_periods=min_wnum,
window=steady_window,
center=True).apply(stats.circstd,
kwargs=circ_kwargs,
raw=True)

scipy 1.4 was released in 2019. I think we could add a limit and drop this. Not sure how we would test for this otherwise

@jklenzing
Copy link
Member Author

Also, I don't see how to trigger the following lines without also creating a valueError later on due to non-integer windows. Is this the intended behaviour?

max_wnum = np.floor(steady_window / sample_rate)
if max_wnum != steady_window / sample_rate:
steady_window = max_wnum * sample_rate
pysat.logger.warning(" ".join(("sample rate is not a factor of the",
"statistical window")))
pysat.logger.warning(" ".join(("new statistical window is",
"{:.1f}".format(steady_window))))

@aburrell
Copy link
Member

aburrell commented Sep 7, 2023

I think dropping the older scipy is fine. Maybe change lines 114-120 to just raise an earlier ValueError, or adjust the input to prevent the ValueError from happening.

@jklenzing
Copy link
Member Author

The valueError comes directly from pandas when the rolling routines are invoked

@jklenzing
Copy link
Member Author

Turns out it was a bug! 🐞

@jklenzing jklenzing mentioned this issue Sep 7, 2023
11 tasks
@jklenzing jklenzing linked a pull request Sep 7, 2023 that will close this issue
11 tasks
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 a pull request may close this issue.

2 participants