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

The Great Purge mk II #2666

Merged
merged 12 commits into from Jul 19, 2018

Conversation

Projects
4 participants
@Cadair
Copy link
Member

commented Jun 20, 2018

This deletes all the deprecated submodules for 1.0

@sunpy-bot

This comment has been minimized.

Copy link

commented Jun 20, 2018

Thanks for the pull request @Cadair! Everything looks great!

@sunpy sunpy deleted a comment from pep8speaks Jun 20, 2018

@Cadair

This comment has been minimized.

Copy link
Member Author

commented Jun 20, 2018

@pep8speaks quiet

@Cadair Cadair added this to the 1.0 milestone Jun 20, 2018

@Cadair Cadair force-pushed the Cadair:removalmk2 branch from 2a2789e to 361dd4d Jun 20, 2018

@Cadair Cadair added the Refactoring label Jun 20, 2018

@Cadair Cadair requested review from dpshelio and nabobalis Jun 20, 2018

@Cadair Cadair added the [Review] label Jun 20, 2018

@Cadair Cadair requested a review from DanRyanIrish Jun 20, 2018

@Cadair

This comment has been minimized.

Copy link
Member Author

commented Jun 20, 2018

@DanRyanIrish this refactors the goes em code to use timeseries if you want to have a look

@Cadair Cadair force-pushed the Cadair:removalmk2 branch 2 times, most recently from a854cda to 42aa747 Jun 22, 2018

Cadair added some commits Jun 20, 2018

@Cadair Cadair force-pushed the Cadair:removalmk2 branch from 42aa747 to 659f282 Jun 22, 2018

@Cadair

This comment has been minimized.

Copy link
Member Author

commented Jun 27, 2018

note to self: I have merged this into the time branch, do not rebase this branch

@nabobalis

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2018

Note to self: MERGE IT NOW, PRESS THE BUTTON.

"CHANNEL2": CHANNELS[1],
"CHANNEL3": CHANNELS[0],
"CHANNEL4": CHANNELS[1]})
def ts():

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

Can we have a more descriptive function name?

@u.quantity_input(longflux=u.W/u.m/u.m, shortflux=u.W/u.m/u.m)
def _goes_chianti_tem(longflux, shortflux, satellite=8,
@u.quantity_input
def _goes_chianti_tem(longflux: u.W/u.m/u.m, shortflux: u.W/u.m/u.m, satellite=8,

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

This syntax is new to me. Presumably it means longflux input must be a quantity with equivalent units to u.W/u.m/u.m?

This comment has been minimized.

Copy link
@Cadair

Cadair Jul 18, 2018

Author Member

indeed.

@@ -774,13 +772,13 @@ def calculate_radiative_loss_rate(goeslc, force_download=False,
Returns
-------
lc_new : `~sunpy.lightcurve.LightCurve`
lc_new : `~sunpy.timeseries.XRSTimeSeries`

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

This Should be be ts_new

2014-01-01 00:00:04.518999 9.187300e-08 0.000004 2.498454e+16 9.530365e+17
2014-01-01 00:00:06.564999 9.298800e-08 0.000004 2.528776e+16 9.530365e+17
>>> import sunpy.timeseries as ts
>>> from sunpy.instr.goes import calculate_temperature_em

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

This should be >>> from sunpy.instr.goes import calculate_xray_luminosity

data=copy.deepcopy(goeslc.data))
lc_new.data["luminosity_xrsa"] = lx_out["shortlum"].to("W").value
lc_new.data["luminosity_xrsb"] = lx_out["longlum"].to("W").value
lc_new = timeseries.XRSTimeSeries(meta=copy.deepcopy(goests.meta),

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

lc_new should be ts_new here.

lc_new = timeseries.XRSTimeSeries(meta=copy.deepcopy(goests.meta),
data=copy.deepcopy(goests.data),
units=copy.deepcopy(goests.units))
lc_new = lc_new.add_column("luminosity_xrsa", lx_out["shortlum"].to("W"))

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

lc_new should be ts_new here.

data=copy.deepcopy(goests.data),
units=copy.deepcopy(goests.units))
lc_new = lc_new.add_column("luminosity_xrsa", lx_out["shortlum"].to("W"))
lc_new = lc_new.add_column("luminosity_xrsb", lx_out["longlum"].to("W"))

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

lc_new should be ts_new here.

data=copy.deepcopy(goests.data),
units=copy.deepcopy(goests.units))
lc_new = lc_new.add_column("luminosity_xrsa", lx_out["shortlum"].to("W"))
lc_new = lc_new.add_column("luminosity_xrsb", lx_out["longlum"].to("W"))

return lc_new

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

lc_new should be ts_new here.


# Test case 2: GOESLightCurve object with flux and temperature
# data, but no EM data.
goes_test = goes.calculate_radiative_loss_rate(goeslc_no_em)
assert_frame_equal(goeslc_test.data, goeslc_expected.data)
# we test that the column has been added
assert "rad_loss_rate" in goes_test.columns

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

Why do we only test the column is added here and not that the values are correct?

This comment has been minimized.

Copy link
@Cadair

Cadair Jul 18, 2018

Author Member

done using pytest-arraydiff

return lyrats


@pytest.mark.remote_data
@pytest.mark.parametrize('dtype', ['ts', 'lc'])
def test_remove_lytaf_events_from_timeseries(dtype):
def test_remove_lytaf_events_from_timeseries(ts):
"""Test if artefacts are correctly removed from a TimeSeries.

This comment has been minimized.

Copy link
@DanRyanIrish

DanRyanIrish Jul 6, 2018

Member

This docstring probably needs updating so it's clear what the input is. The mention of the LYRALightCurve can probably go too.

@DanRyanIrish

This comment has been minimized.

Copy link
Member

commented Jul 6, 2018

Now that all the lightcurve sources have been removed, can you remind me how TimeSeries handles different sources? It's a factory-like setup like Map which detects the source from the input file?

#!/bin/bash

commitmessage=$(git log --pretty=%B -n 1)
if [[ $commitmessage = *"[ci skip]"* ]]; then

This comment has been minimized.

Copy link
@vn-ki

vn-ki Jul 6, 2018

Member

Travis supports both [skip ci] and [ci skip]. Personally I prefer, [skip ci]. Shouldn't we support both?

@@ -754,8 +752,8 @@ def calculate_radiative_loss_rate(goeslc, force_download=False,
Parameters
----------
goeslc : `~sunpy.lightcurve.LightCurve`
LightCurve object containing GOES data. The units of these
goeslc : `~sunpy.timeseries.XRSTimeSeries`

This comment has been minimized.

Copy link
@vn-ki

vn-ki Jul 6, 2018

Member

You missed ts here.

@@ -67,17 +67,17 @@ def test_goes_event_list():
def test_calculate_temperature_em():
# Create GOESLightcurve object, then create new one with

This comment has been minimized.

Copy link
@vn-ki

vn-ki Jul 6, 2018

Member

Comment and the rest of the function needs updating.

@Cadair Cadair referenced this pull request Jul 18, 2018

Merged

Migrate to Astropy Time #2691

2 of 2 tasks complete

Cadair added some commits Jul 18, 2018

@Cadair

This comment has been minimized.

Copy link
Member Author

commented Jul 18, 2018

@DanRyanIrish yes if it can be autodetected, i.e. its not a csv file, there is also a format= kwarg for when it cant be auto detected.

@Cadair Cadair merged commit 98cced8 into sunpy:master Jul 19, 2018

9 checks passed

Giles Click details to preview the documentation build
Details
ci/circleci: egg-info-36 Your tests passed on CircleCI!
Details
ci/circleci: figure-tests-36 Your tests passed on CircleCI!
Details
ci/circleci: html-docs Your tests passed on CircleCI!
Details
codecov/patch 97.72% of diff hit (target 84.06%)
Details
codecov/project 85.61% (+1.54%) compared to 58e5b32
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
sunpy-bot All checks passed

@Cadair Cadair deleted the Cadair:removalmk2 branch Jul 19, 2018

@nabobalis nabobalis added this to Finished in SunPy 1.0 Sep 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.