8000 [MNT] URLs changed on CRAN; updated _fpp3_loaders.py accordingly by ericjb · Pull Request #7084 · sktime/sktime · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[MNT] URLs changed on CRAN; updated _fpp3_loaders.py accordingly #7084

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

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

ericjb
Copy link
Contributor
@ericjb ericjb commented Sep 6, 2024

FPP3 datasets are loaded from CRAN, using fixed URLs. CRAN updated two of the three URLs used by _fpp3_loaders.py. This PR updates the URLs accordingly (otherwise the functionality is broken.)

A reviewer can run the following code to test the change, if desired.

import matplotlib.pyplot as plt
from sktime.datasets import load_fpp3
from sktime.utils.plotting import plot_series
y = load_fpp3('aus_production')['Beer']
fig, ax = plot_series(y)
plt.show()

Copy link
Collaborator
@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

hm, we ran a full test suite today and this was not detected - are the tests covering success of downloads properly?

(the request is to clarify, and if not, then we should add tests)

@fkiraly
Copy link
Collaborator
fkiraly commented Sep 6, 2024

we could also upload the data to the sktime huggingface, where they would be ensured to be stable

@fkiraly fkiraly added bugfix Fixes a known bug or removes unintended behavior module:datasets&loaders data sets and data loaders labels Sep 6, 2024
@ericjb
Copy link
Contributor Author
ericjb commented Sep 7, 2024

With help from GitHub Copilot, here is a sample test function to be added to the test suite. Please suggest changes or explain where this test function should be placed so that it becomes part of the "full test suite". Thanks

import requests

def fpp3_test():
    """Unit test function for _fpp3_loaders.py"""
    url_fpp3 = "https://cran.r-project.org/src/contrib/fpp3_1.0.0.tar.gz"
    url_tsibble = "https://cran.r-project.org/src/contrib/tsibble_1.1.5.tar.gz"
    url_tsibbledata = "https://cran.r-project.org/src/contrib/tsibbledata_0.4.1.tar.gz"

    urls = [url_fpp3, url_tsibble, url_tsibbledata]

    for url in urls:
        try:
            response = requests.head(url)
            if response.status_code != 200:
                return False
        except requests.RequestException as e:
            return False

    return True

@ericjb
Copy link
Contributor Author
ericjb commented Sep 8, 2024

I responded to this request with sample test. Please advise if this is an ok test and where to place it. Thanks

@fkiraly
Copy link
Collaborator
fkiraly commented Sep 8, 2024

Hm, looks good with one minor issue: if we do it this way, we would have to update the dataset URL in two places, and if one changes it in only one place (e.g., next time we need to update), the test will no longer work.

We should hence use _get_dataset_url in the test.

@ericjb
Copy link
Contributor Author
ericjb commented Sep 9, 2024

Good point about the duplication of the url's. Fixed. Good catch. Released.

@ericjb ericjb requested a review from fkiraly September 9, 2024 17:41
Copy link
Collaborator
@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

Thanks.

@fkiraly fkiraly merged commit aeae5b0 into sktime:main Sep 9, 2024
56 checks passed
@fkiraly fkiraly changed the title URLs changed on CRAN; updated _fpp3_loaders.py accordingly [MNT] URLs changed on CRAN; updated _fpp3_loaders.py accordingly Sep 9, 2024
@fkiraly fkiraly added the maintenance Continuous integration, unit testing & package distribution label Sep 9, 2024
benHeid pushed a commit to Z-Fran/sktime that referenced this pull request Oct 3, 2024
FPP3 datasets are loaded from CRAN, using fixed URLs. CRAN updated two
of the three URLs used by _fpp3_loaders.py. This PR updates the URLs
accordingly (otherwise the functionality is broken.)

A reviewer can run the following code to test the change, if desired. 

```
import matplotlib.pyplot as plt
from sktime.datasets import load_fpp3
from sktime.utils.plotting import plot_series
y = load_fpp3('aus_production')['Beer']
fig, ax = plot_series(y)
plt.show()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a known bug or removes unintended behavior maintenance Continuous integration, unit testing & package distribution module:datasets&loaders data sets and data loaders
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0