Skip to content

Add conda-forge mpl_sample_data package to docs #18797

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

Closed
story645 opened this issue Oct 23, 2020 · 6 comments
Closed

Add conda-forge mpl_sample_data package to docs #18797

story645 opened this issue Oct 23, 2020 · 6 comments
Labels
Documentation Good first issue Open a pull request against these issues if there are no active ones!
Milestone

Comments

@story645
Copy link
Member

story645 commented Oct 23, 2020

Problem

The sample data is not in the wheels installed by PyPi and the instructions at https://matplotlib.org/users/installing.html#test-data are to grab the data manually.

Solution

There's a matplotlib maintained sample_data package in conda forge that should at the least be mentioned on that page:

conda install -c conda-forge mpl_sample_data
@story645 story645 added Documentation Good first issue Open a pull request against these issues if there are no active ones! labels Oct 23, 2020
@story645 story645 changed the title Add conda-forge mpl_sample_data package to dos Add conda-forge mpl_sample_data package to docs Oct 23, 2020
@ianhi
Copy link
Contributor

ianhi commented Oct 23, 2020

Maybe also in the examples that use it? I went through some stackoverflowing about this earlier today when copy pasting the https://matplotlib.org/3.3.0/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py resulted in an error

@story645
Copy link
Member Author

Totally agree! Opened this issue after trying to run your PR to figure out if I could add dashes.

@timhoffm
Copy link
Member

We should also add a pip command for non-conda users. I did not see a package on pypi. But one can always install directly from the GitHub repository.

@anntzer
Copy link
Contributor

anntzer commented Oct 23, 2020

Actually, I think we should just remove the ability to (officially) split the sample data away from the main package, and ask conda to stop doing so as well. Indeed, after #18691 (which was motivated by this goal), the whole sample_data folder is smaller than e.g. most extension modules.

diff --git i/setup.cfg.template w/setup.cfg.template
index 00ae11c7a..2e2249974 100644
--- i/setup.cfg.template
+++ w/setup.cfg.template
@@ -20,7 +20,6 @@ license_files = LICENSE/*
 # considered optional. All except 'tests' data (meaning the baseline
 # image files) are installed by default, but that can be changed here.
 #tests = False
-#sample_data = True
 
 [gui_support]
 # Matplotlib supports multiple GUI toolkits, known as backends.
diff --git i/setup.py w/setup.py
index 062732097..801e41814 100644
--- i/setup.py
+++ w/setup.py
@@ -58,7 +58,6 @@ mpl_packages = [
     setupext.Python(),
     setupext.Platform(),
     setupext.FreeType(),
-    setupext.SampleData(),
     setupext.Tests(),
     setupext.BackendMacOSX(),
     ]
diff --git i/setupext.py w/setupext.py
index 074223084..dd355264f 100644
--- i/setupext.py
+++ w/setupext.py
@@ -327,6 +327,7 @@ class Matplotlib(SetupPackage):
                 'mpl-data/matplotlibrc',
                 *_pkg_data_helper('matplotlib', 'mpl-data/fonts'),
                 *_pkg_data_helper('matplotlib', 'mpl-data/images'),
+                *_pkg_data_helper('matplotlib', 'mpl-data/sample_data'),
                 *_pkg_data_helper('matplotlib', 'mpl-data/stylelib'),
                 *_pkg_data_helper('matplotlib', 'backends/web_backend'),
                 '*.dll',  # Only actually matters on Windows.
@@ -439,21 +440,6 @@ class Matplotlib(SetupPackage):
         yield ext
 
 
-class SampleData(OptionalPackage):
-    """
-    This handles the sample data that ships with matplotlib.  It is
-    technically optional, though most often will be desired.
-    """
-    name = "sample_data"
-
-    def get_package_data(self):
-        return {
-            'matplotlib': [
-                *_pkg_data_helper('matplotlib', 'mpl-data/sample_data'),
-            ],
-        }
-
-
 class Tests(OptionalPackage):
     name = "tests"
     default_config = False

(+ corresponding docs) should suffice.

ramosdatalike added a commit to ramosdatalike/matplotlib that referenced this issue Nov 15, 2020
@ianhi
Copy link
Contributor

ianhi commented Feb 5, 2021

Is this closed by #19383 ?

@anntzer
Copy link
Contributor

anntzer commented Feb 5, 2021

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Good first issue Open a pull request against these issues if there are no active ones!
Projects
None yet
Development

No branches or pull requests

5 participants