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

Moved timeseries peek to plot() #5200

Merged
merged 1 commit into from
Jun 22, 2021
Merged

Conversation

jeffreypaul15
Copy link
Contributor

@jeffreypaul15 jeffreypaul15 commented Apr 11, 2021

Description

Fixes #5066
Drawing parallels from GenericMap, I suppose this is along the lines of what we want?
This does override the base plot() method defined for TimeSeries though.

@jeffreypaul15 jeffreypaul15 requested a review from a team as a code owner April 11, 2021 00:56
@pep8speaks
Copy link

pep8speaks commented Apr 11, 2021

Hello @jeffreypaul15! Thanks for updating this PR.

Line 86:74: E228 missing whitespace around modulo operator

Line 88:79: E228 missing whitespace around modulo operator

Comment last updated at 2021-06-20 12:40:28 UTC

@nabobalis nabobalis marked this pull request as draft April 11, 2021 07:47
@nabobalis nabobalis added timeseries Affects the timeseries submodule No Backport A PR that isn't to be backported to any release branch. (To be used as a flag to other maintainers) labels Apr 11, 2021
@jeffreypaul15
Copy link
Contributor Author

@ayshih Is this something along the lines of what we want?

@nabobalis
Copy link
Contributor

This looks like something we want, tho It will need to be done for each time series source since they all have their own peek method.

@jeffreypaul15
Copy link
Contributor Author

This looks like something we want, tho It will need to be done for each time series source since they all have their own peek method.

Yeah, I just made the change for this one source to confirm if this is what we want. Shall I go about with the rest?

@nabobalis
Copy link
Contributor

Sure

@jeffreypaul15
Copy link
Contributor Author

jeffreypaul15 commented Apr 15, 2021

@nabobalis I've added all the TimeSeries sources, but like I mentioned, this does override the plot() method defined in the base TimeSeries class, how would we want to handle that?

@nabobalis
Copy link
Contributor

@nabobalis I've added all the TimeSeries sources, but like I mentioned, this does overwrite the plot() method defined in the base TimeSeries class, how would we want to handle that?

You mean it overloads it?

@jeffreypaul15
Copy link
Contributor Author

You mean it overloads it?

No, I am overriding the plot method right

@nabobalis
Copy link
Contributor

You mean it overloads it?

No, I am overriding the plot method right

I don't see the issue. What would be the problem.

@jeffreypaul15
Copy link
Contributor Author

You mean it overloads it?

No, I am overriding the plot method right

I don't see the issue. What would be the problem.

We lose that functionality, basically the ability to call the base plot method. Is that fine?

@nabobalis
Copy link
Contributor

You mean it overloads it?

No, I am overriding the plot method right

I don't see the issue. What would be the problem.

We lose that functionality, basically the ability to call the base plot method. Is that fine?

Don't see why not.

@jeffreypaul15
Copy link
Contributor Author

What changelog would this PR require?

@nabobalis
Copy link
Contributor

What changelog would this PR require?

Not sure. It feels kind of breaking to make plot do all this formatting but it doesn't actually break anything.

@jeffreypaul15
Copy link
Contributor Author

Not sure. It feels kind of breaking to make plot do all this formatting but it doesn't actually break anything.

Shall I go with feature then?

@nabobalis
Copy link
Contributor

Sure.

@jeffreypaul15
Copy link
Contributor Author

Sure.

Need to word the changelog better, please make the required changes.

@jeffreypaul15
Copy link
Contributor Author

@nabobalis I don't suppose extra tests are needed right? The test for peek() covers plot() so would we need separate tests for plot()?

@nabobalis
Copy link
Contributor

@nabobalis I don't suppose extra tests are needed right? The test for peek() covers plot() so would we need separate tests for plot()?

No it should be ok.

@jeffreypaul15
Copy link
Contributor Author

@nabobalis Anything else to be done in this PR?

@nabobalis nabobalis added the Needs Review Needs reviews before merge. label Apr 20, 2021
@nabobalis
Copy link
Contributor

It will need a review.

@nabobalis
Copy link
Contributor

nabobalis commented May 21, 2021

the colours aren't in accordance with when the user doesn't pass any axes as we're plotting each column of the dataframe separately on each of the axes passed, we could fix this by having a colours array but that is specific to this dataframe and I don't suppose that's right to do

Why?

I was under the assumption that this would be used for a variety of dataframes where the columns might exceed the default number of colours that we specify right?

Maybe? Just add the colours and cycle through them.

@jeffreypaul15
Copy link
Contributor Author

the colours aren't in accordance with when the user doesn't pass any axes as we're plotting each column of the dataframe separately on each of the axes passed, we could fix this by having a colours array but that is specific to this dataframe and I don't suppose that's right to do

Why?

I was under the assumption that this would be used for a variety of dataframes where the columns might exceed the default number of colours that we specify right?

Maybe?

dataframe.plot() handles this by itself, including the rotation of the xticklabels so by plotting it separately we would need to manually set all of this

@nabobalis
Copy link
Contributor

the colours aren't in accordance with when the user doesn't pass any axes as we're plotting each column of the dataframe separately on each of the axes passed, we could fix this by having a colours array but that is specific to this dataframe and I don't suppose that's right to do

Why?

I was under the assumption that this would be used for a variety of dataframes where the columns might exceed the default number of colours that we specify right?

Maybe?

dataframe.plot() handles this by itself, including the rotation of the xticklabels so by plotting it separately we would need to manually set all of this

I guess we add it then?

@jeffreypaul15
Copy link
Contributor Author

jeffreypaul15 commented May 21, 2021

I guess we add it then?

I've added the exact colours that are cycled, rotated the xticks to match and also updated the docs figure to be of a figsize=(20,10), the plot should now be rendered properly.

@nabobalis nabobalis force-pushed the sunpy-5066 branch 2 times, most recently from bc389f8 to 18115c2 Compare June 18, 2021 17:17
@jeffreypaul15
Copy link
Contributor Author

@nabobalis A few sources (lyra and fermi_gbm) derive their title from the dataframe :
axes[0].set_title("LYRA ({0:{1}})".format(self.to_dataframe().index[0], TIME_FORMAT))
Do we still accept a default title argument here?

@nabobalis
Copy link
Contributor

@nabobalis A few sources (lyra and fermi_gbm) derive their title from the dataframe :
axes[0].set_title("LYRA ({0:{1}})".format(self.to_dataframe().index[0], TIME_FORMAT))
Do we still accept a default title argument here?

Sure.

@nabobalis
Copy link
Contributor

Can this be squash merged and rebased please?

@nabobalis
Copy link
Contributor

nabobalis commented Jun 22, 2021

I wanted to check what plot vs peek looked light right now.
I used the test data.
Each plot is plot then peek.

noaa_json_pre

noaa_json_pre_plot
noaa_json_pre_peek

noaa_pre_json

noaa_pre_json_peek
noaa_pre_json_plot

norh

norh plot broke for me but peek worked.
norh_peek

rhessi

rhessi_plot
rhessi_peek

esp

esp_plot
esp_peek

eve

eve_plot
eve_peek

fermi_gbm

fermi_gbm_plot
fermi_gbm_peek

goes

goes_plot
goes_peek

lyra

lyra_plot
lyra_peek

There are still some big differences? Is there anyway to resolve this?

Copy link
Contributor

@nabobalis nabobalis left a comment

Choose a reason for hiding this comment

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

Undoing my approval.

@jeffreypaul15
Copy link
Contributor Author

jeffreypaul15 commented Jun 22, 2021

@nabobalis These differences are resolved in this PR right?
Running all peek and plot methods from this PR look alike for me

@nabobalis
Copy link
Contributor

nabobalis commented Jun 22, 2021

I will double check I had checked out the correct code but this was from my attempt at testing this PR.

@jeffreypaul15
Copy link
Contributor Author

I will double check I had checked out the correct code but this was from my attempt at testing this PR.

Sure, the current release version has the same differences that you've mentioned

@nabobalis
Copy link
Contributor

I had sunpy installed twice in my env and this created the conflict.

@nabobalis nabobalis merged commit bd5fa84 into sunpy:main Jun 22, 2021
@nabobalis
Copy link
Contributor

Thanks again @jeffreypaul15

@dstansby dstansby removed the Needs Review Needs reviews before merge. label Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Backport A PR that isn't to be backported to any release branch. (To be used as a flag to other maintainers) timeseries Affects the timeseries submodule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move custom timeseries plotting from from peek to plot
6 participants