-
-
Notifications
You must be signed in to change notification settings - Fork 378
chore!: replace direct download of nyc_taxi with hvsampledata #1462
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
base: main
Are you sure you want to change the base?
Changes from all commits
b0f4c04
015d39a
39ec30e
c54c98d
3ff0ebf
17d6402
83e277e
ecfbfab
c48447c
0f657bd
8ba61da
192dd62
a916499
b94cb86
49c3e22
70ff1e8
1a8b640
f16f4dd
3089271
7b4586e
db073d8
0e7d3b5
78ac90f
22e7fc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,12 +18,36 @@ | |
| from . import datatypes # noqa (API import) | ||
|
|
||
| # make pyct's example/data commands available if possible | ||
| from functools import partial | ||
| from functools import partial, wraps | ||
|
|
||
|
|
||
| def _warn_pyct_deprecated(stacklevel=2): | ||
| import warnings | ||
|
|
||
| warnings.warn( | ||
| "The 'fetch_data()', 'copy_examples()', and 'examples()' functions are " | ||
| "deprecated since version 0.19 and will be removed in version 0.20. " | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the release candidacy of datashader, I feel like 0.20 would be released at least 6 months after 0.19. Seems like each minor release has been a year in between (ignoring 0.17.0, which did not correctly drop a Python version).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so do you suggest we remove it in 0.19.xx, and modify the message to that effect?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. I suggest 0.20, and not 0.21. We would never drop something in a patch release.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, the message is correct then. It says 0.20 already.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but still want to highlight it as we normally do two minor releases. |
||
| "For downloading sample datasets, use 'hvsampledata' instead. " | ||
| "For example: `hvsampledata.nyc_taxi_remote('pandas')`.", | ||
| category=FutureWarning, | ||
| stacklevel=stacklevel, | ||
| ) | ||
|
|
||
|
|
||
| def _deprecated_pyct_wrapper(func): | ||
| """Wrapper to add deprecation warning to pyct functions.""" | ||
| @wraps(func) # noqa: F821 | ||
| def wrapper(*args, **kwargs): | ||
| _warn_pyct_deprecated(stacklevel=3) | ||
| return func(*args, **kwargs) | ||
| return wrapper | ||
|
|
||
|
|
||
| try: | ||
| from pyct.cmd import copy_examples as _copy, fetch_data as _fetch, examples as _examples | ||
hoxbro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| copy_examples = partial(_copy,'datashader') | ||
| fetch_data = partial(_fetch,'datashader') | ||
| examples = partial(_examples,'datashader') | ||
| copy_examples = _deprecated_pyct_wrapper(partial(_copy, 'datashader')) | ||
| fetch_data = _deprecated_pyct_wrapper(partial(_fetch, 'datashader')) | ||
| examples = _deprecated_pyct_wrapper(partial(_examples, 'datashader')) | ||
| except ImportError: | ||
| def _missing_cmd(*args,**kw): | ||
| return("install pyct to enable this command (e.g. `conda install pyct or " | ||
|
|
@@ -32,4 +56,4 @@ def _missing_cmd(*args,**kw): | |
| def err(): | ||
| raise ValueError(_missing_cmd()) | ||
| fetch_data = copy_examples = examples = err | ||
| del partial, _examples, _copy, _fetch | ||
| del partial, wraps, _examples, _copy, _fetch | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's
del wrapsas we did with the others.