usds / justice40-tool

A tool to identify disadvantaged communities due to environmental, socioeconomic and health burdens
https://screeningtool.geoplatform.gov/
Creative Commons Zero v1.0 Universal
134 stars 43 forks source link

Matplotlib missing from `score/` requirements #322

Closed widal001 closed 3 years ago

widal001 commented 3 years ago

Describe the bug When attempting to run the first cell ipython/score_calc.ipynb (after following the local development instructions for the directory) you get the following ModuleNotFoundError for matplotlib because it's not listed in the pyproject.toml or poetry.lock file.

To Reproduce Steps to reproduce the behavior:

  1. Follow the local development instructions for the score/ directory
  2. Execute the following iPython notebooks in this order:
    1. ejscreen_etl.ipynb
    2. census_etl.ipynb
    3. housing_and_transportation_etl.ipynb
    4. hud_housing_etl.ipynb
    5. score_calc.ipynb
  3. On the final notebook, run the code in the first cell with the line import matplotlib.pyplot as plt
  4. This should return the error message screenshotted below

Expected behavior Matplotlib should be imported without errors. This error is being returned because the matplotlib library is missing from the poetry.lock and the pyproject.toml

Screenshots

Screen Shot 2021-07-10 at 4 28 31 PM

Desktop (please complete the following information):

appdirs                           1.4.4     A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".
appnope                           0.1.2     Disable App Nap on macOS >= 10.9
argon2-cffi                       20.1.0    The secure Argon2 password hashing algorithm.
async-generator                   1.10      Async generators and context managers for Python 3.5+
attrs                             21.2.0    Classes Without Boilerplate
backcall                          0.2.0     Specifications for callback functions passed in to an API
black                             21.6b0    The uncompromising code formatter.
bleach                            3.3.0     An easy safelist-based HTML-sanitizing tool.
censusdata                        1.13      Download data from U.S. Census API
certifi                           2021.5.30 Python package for providing Mozilla's CA Bundle.
cffi                              1.14.5    Foreign Function Interface for Python calling C code.
chardet                           4.0.0     Universal encoding detector for Python 2 and 3
click                             8.0.1     Composable command line interface toolkit
decorator                         5.0.9     Decorators for Humans
defusedxml                        0.7.1     XML bomb protection for Python stdlib modules
dynaconf                          3.1.4     The dynamic configurator for your Python Project
entrypoints                       0.3       Discover and load entry points from installed packages.
idna                              2.10      Internationalized Domain Names in Applications (IDNA)
ipykernel                         5.5.5     IPython Kernel for Jupyter
ipython                           7.24.1    IPython: Productive Interactive Computing
ipython-genutils                  0.2.0     Vestigial utilities from IPython
ipywidgets                        7.6.3     IPython HTML widgets for Jupyter
jedi                              0.18.0    An autocompletion tool for Python that can be used for text editors.
jinja2                            3.0.1     A very fast and expressive template engine.
jsonschema                        3.2.0     An implementation of JSON Schema validation for Python
jupyter                           1.0.0     Jupyter metapackage. Install all the Jupyter components in one go.
jupyter-client                    6.2.0     Jupyter protocol implementation and client libraries
jupyter-console                   6.4.0     Jupyter terminal console
jupyter-contrib-core              0.3.3     Common utilities for jupyter-contrib projects.
jupyter-contrib-nbextensions      0.5.1     A collection of Jupyter nbextensions.
jupyter-core                      4.7.1     Jupyter core package. A base package on which Jupyter projects rely.
jupyter-highlight-selected-word   0.2.0     Jupyter notebook extension that enables highlighting every instance of the current word in the notebook.
jupyter-latex-envs                1.4.6     Jupyter notebook extension which supports (some) LaTeX environments within markdown cells. Also provides sup...
jupyter-nbextensions-configurator 0.4.1     jupyter serverextension providing configuration interfaces for nbextensions.
jupyterlab-pygments               0.1.2     Pygments theme using JupyterLab CSS variables
jupyterlab-widgets                1.0.0     A JupyterLab extension.
lxml                              4.6.3     Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
markupsafe                        2.0.1     Safely add untrusted strings to HTML/XML markup.
matplotlib-inline                 0.1.2     Inline Matplotlib backend for Jupyter
mistune                           0.8.4     The fastest markdown parser in pure Python
mypy                              0.910     Optional static typing for Python
mypy-extensions                   0.4.3     Experimental type system extensions for programs checked with the mypy typechecker.
nbclient                          0.5.3     A client library for executing notebooks. Formerly nbconvert's ExecutePreprocessor.
nbconvert                         6.1.0     Converting Jupyter Notebooks
nbformat                          5.1.3     The Jupyter Notebook format
nest-asyncio                      1.5.1     Patch asyncio to allow nested event loops
notebook                          6.4.0     A web-based notebook environment for interactive computing
numpy                             1.21.0    NumPy is the fundamental package for array computing with Python.
packaging                         20.9      Core utilities for Python packages
pandas                            1.2.5     Powerful data structures for data analysis, time series, and statistics
pandocfilters                     1.4.3     Utilities for writing pandoc filters in python
parso                             0.8.2     A Python Parser
pathspec                          0.8.1     Utility library for gitignore style pattern matching of file paths.
pexpect                           4.8.0     Pexpect allows easy control of interactive console applications.
pickleshare                       0.7.5     Tiny 'shelve'-like database with concurrency support
prometheus-client                 0.11.0    Python client for the Prometheus monitoring system.
prompt-toolkit                    3.0.19    Library for building powerful interactive command lines in Python
ptyprocess                        0.7.0     Run a subprocess in a pseudo terminal
pycparser                         2.20      C parser in Python
pygments                          2.9.0     Pygments is a syntax highlighting package written in Python.
pyparsing                         2.4.7     Python parsing module
pyrsistent                        0.17.3    Persistent/Functional/Immutable data structures
python-dateutil                   2.8.1     Extensions to the standard Python datetime module
pytz                              2021.1    World timezone definitions, modern and historical
pyyaml                            5.4.1     YAML parser and emitter for Python
pyzmq                             22.1.0    Python bindings for 0MQ
qtconsole                         5.1.0     Jupyter Qt console
qtpy                              1.9.0     Provides an abstraction layer on top of the various Qt bindings (PyQt5, PyQt4 and PySide) and additional cus...
regex                             2021.4.4  Alternative regular expression module, to replace re.
requests                          2.25.1    Python HTTP for Humans.
send2trash                        1.7.1     Send file to trash natively under Mac OS X, Windows and Linux.
six                               1.16.0    Python 2 and 3 compatibility utilities
terminado                         0.10.1    Tornado websocket backend for the Xterm.js Javascript terminal emulator library.
testpath                          0.5.0     Test utilities for code working with files and commands
toml                              0.10.2    Python Library for Tom's Obvious, Minimal Language
tornado                           6.1       Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
traitlets                         5.0.5     Traitlets Python configuration system
types-requests                    2.25.0    Typing stubs for requests
typing-extensions                 3.10.0.0  Backported and Experimental Type Hints for Python 3.5+
urllib3                           1.26.5    HTTP library with thread-safe connection pooling, file post, and more.
wcwidth                           0.2.5     Measures the displayed width of unicode strings in a terminal
webencodings                      0.5.1     Character encoding aliases for legacy web content
widgetsnbextension                3.5.1     IPython HTML widgets for Jupyter

Additional context The simple fix for this bug is to use poetry add matplotlib to add it as a dependency for the project. I'll add this with my PR for the documentation in #198

widal001 commented 3 years ago

No longer relevant since #260 was merged and removed the need for matplotlib