Giter Site home page Giter Site logo

birthbaum / greater-chicago-food-despository Goto Github PK

View Code? Open in Web Editor NEW

This project forked from code-312/greater-chicago-food-despository

0.0 0.0 0.0 2.43 MB

License: MIT License

Shell 0.10% Python 32.61% Batchfile 0.06% Jupyter Notebook 67.23%

greater-chicago-food-despository's Introduction

run-tests

Code for Chicago Mapping Project Backend

This project is a set of Python scripts that generate data for an interactive map of food insecurity, food assistance program participation and demographics in Illinois. Running this project outputs JSON files that can be used by the frontend.

Getting Started

Prerequisites

  1. The latest version of Python 3.9
  2. The latest version of Git
  3. A Census API Key, which can be obtained by filling out this form

Running for the first time

  1. Ensure Python and Git are installed.
  2. Create a local directory, and open a command prompt there.
  3. Clone the repository with Git:
git clone https://github.com/Code-For-Chicago/greater-chicago-food-despository.git . 
  1. Create a file called .env in the root directory. This file is ignored via the .gitignore file to avoid committing secrets.
  2. Open .env in a text editor and add this as the contents, replacing the second part with your personal Census API key:
CENSUS_KEY=REPLACE_ME_WITH_CENSUS_API_KEY
  1. Install required modules in requirements.txt
    • Mac/Linux: pip3 install -r requirements.txt
    • Windows: pip install -r requirements.txt
  2. Run start script to verify your setup is correct
    • Mac/Linux:
      • Make script executable chmod 755 start.sh
      • Run start.sh via terminal or double click
    • Windows: run start.bat via command line or double click
  3. If the tests do not pass, check your .env file and your installed python package versions

Running the Project

If the start script succeeds, you can run the project with:

  • Mac/Linux: python3 src/main.py
  • Windows: python src\main.py

Running the project generates output files in the final_jsons folder.

To run with memory profiling:

  • Mac/Linux:
    1. Make sure the script is executable: chmod 755 memory_profiling/run_main.sh
    2. Run the script: ./memory_profiling/run_main.sh
    3. View the report: memory_profiling/memory_profile_report.txt
  • Windows CMD/Powershell:
    1. Run the script: .\memory_profiling\run_main.bat
    2. View the report: memory_profiling\memory_profile_report.txt

Exploring the Data

After code runs, you can view the data in a Jupyter notebook at getting_started/example.ipynb

  • To open the notebook with VSCode, install the Python and Jupyter extensions
  • To open the notebook with JupyterLab, see here

Running the Tests

  1. To run the unit tests, run pytest from the root directory.
  2. Run flake8 from the root directory to check that code style rules have been followed.
  3. Run mypy src --ignore-missing-imports and mypy tests --ignore-missing-imports from the root directory to check for type errors.
  4. Also see the GitHub Actions for the full list of tests that run in continuous integration.

See Also

GitHub Guides for tutorials on GitHub development and workflows

Data Pipeline

For documentation of the various input data and output data, see data_pipeline.md.

greater-chicago-food-despository's People

Contributors

brickman1444 avatar michaelpkuhn avatar stephenwoo avatar jordenk avatar ellenglight avatar ryan-koch avatar dannmorr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.