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

Support pandas>=0.18.1 #443

Merged
merged 4 commits into from
Oct 2, 2017
Merged

Support pandas>=0.18.1 #443

merged 4 commits into from
Oct 2, 2017

Conversation

yankees714
Copy link
Contributor

Copy link
Contributor

@twiecki twiecki left a comment

Choose a reason for hiding this comment

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

LGTM!

@twiecki
Copy link
Contributor

twiecki commented Sep 26, 2017

We should probably add this to travis as well.

@yankees714
Copy link
Contributor Author

@twiecki how would I go about doing that?

@twiecki
Copy link
Contributor

twiecki commented Sep 26, 2017

@yankees714
Copy link
Contributor Author

Ah got it, thanks. Do we want all python/pandas combinations?

@twiecki
Copy link
Contributor

twiecki commented Sep 27, 2017

Yes.

@twiecki
Copy link
Contributor

twiecki commented Sep 27, 2017

Need to wait for #442 to fix the current breakage.

@vikram-narayan
Copy link
Contributor

merging #442 once tests pass

@twiecki
Copy link
Contributor

twiecki commented Sep 27, 2017

@yankees714 Can you rebase from master?

Andrew Daniels added 2 commits September 27, 2017 11:52
If DataFrame.columns has a name set, it was previously maintained by
DataFrame.join, but no longer is in recent versions of pandas. This
commit resets DataFrame.columns.name before returning, so that the same
dataframe is returned across pandas versions.
Copy link
Contributor

@vikram-narayan vikram-narayan left a comment

Choose a reason for hiding this comment

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

LGTM, just had two small questions

.travis.yml Outdated
- "2.7"
- "3.5"
- "3.6"
matrix:
Copy link
Contributor

Choose a reason for hiding this comment

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

is adding time to the travis build something we're worried about?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly, any thoughts on this @twiecki, @richafrank?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not worried about it.

Copy link
Member

Choose a reason for hiding this comment

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

Each job in the matrix would still take the same amount of time, so we wouldn't suffer any new timeouts. I definitely think we should test an environment that matches what we test for zipline; the others I'm less concerned about. I think we have 4 workers - What's the wall time for a build now?

Is it possible for us to specify the factor, so travis expands the matrix itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the last build on this branch it was 20-30 minutes per job, a bit over an hour total.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also yeah looks like we should be able to have travis do the expansion, I'll take a look at that

Copy link
Member

Choose a reason for hiding this comment

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

An hour sounds kinda painful to me, but as consumers, what do you all think?

pyfolio/risk.py Outdated
# drop all-nan rows before the call to `quantile`, and then
# restore them by reindexing the final result. This is fixed
# in pandas 0.19.
longed_threshold = 100*longed_frac.dropna(how='all').quantile(
Copy link
Contributor

Choose a reason for hiding this comment

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

will this fail flake8 if there aren't spaces around *?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently not, as I was just leaving this as it was. For some reason thought we were consistently not including the whitespace in this project, but now that I look again it seems like we do include it more often that not. I'll update this and the other occurrences in this file.

@yankees714
Copy link
Contributor Author

@vikram-narayan I realized there was an issue with one of the workarounds, so I had to modify it (a391f8a), mind taking another look?

Copy link
Contributor

@vikram-narayan vikram-narayan left a comment

Choose a reason for hiding this comment

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

just had one question on that commit, lgtm otherwise

# pandas 0.18, use np.nanpercentile by applying to each row of
# the dataframe. This is fixed in pandas 0.19.
#
# longed_threshold = 100*longed_frac.quantile(percentile, axis='columns')
Copy link
Contributor

Choose a reason for hiding this comment

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

cruft?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just leaving these as a reference for when we no longer need to support 0.18, does that sound alright?

Copy link
Contributor

Choose a reason for hiding this comment

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

yup sounds good

@vikram-narayan
Copy link
Contributor

actually looks like the travis build failed, is that due to the most recent change?

@twiecki
Copy link
Contributor

twiecki commented Sep 29, 2017

@vikram-narayan I think conda is still broken.

@vikram-narayan
Copy link
Contributor

I think @yankees714 included a workaround for that, it looks like python 3.6 and pandas 0.18.1 are incompatible, from one of the travis builds:

UnsatisfiableError: The following specifications were found to be in conflict:
  - pandas 0.18.1* -> numpy 1.10* -> python 2.7* -> openssl 1.0.1*
  - python 3.6*
Use "conda info <package>" to see the dependencies for each package.

Andrew Daniels added 2 commits October 2, 2017 10:30
Also updates .travis.yml to build on pandas 0.18.1, 0.19.2, and 0.20.3.
@yankees714
Copy link
Contributor Author

Only remaining concern here was build time - it currently stands at 45 minutes which seems tolerable to me. Going to merge, we can cut time later if need be.

@yankees714 yankees714 merged commit d3a7892 into master Oct 2, 2017
@yankees714 yankees714 deleted the pandas-0.18.1-support branch October 2, 2017 16:49
@twiecki
Copy link
Contributor

twiecki commented Oct 2, 2017

Awesome! Should probably release a new version then.

@joshpayne
Copy link

@twiecki should we align to completion of the first round of perf attribution studies/tearsheets?

@twiecki
Copy link
Contributor

twiecki commented Oct 9, 2017

@joshpayne I think we're fine with what we have now.

@yankees714 yankees714 mentioned this pull request Oct 10, 2017
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.

5 participants