plastics-prototype

Decision support tool for plastics policy.

https://github.com/schmidtdse/plastics-prototype

Science Score: 85.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: nature.com, science.org
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
    Organization schmidtdse has institutional domain (dse.berkeley.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.9%) to scientific vocabulary

Keywords from Contributors

mesh interpretability sequences generic projection interactive optim hacking network-simulation
Last synced: 6 months ago · JSON representation ·

Repository

Decision support tool for plastics policy.

Basic Info
  • Host: GitHub
  • Owner: SchmidtDSE
  • License: other
  • Language: JavaScript
  • Default Branch: main
  • Size: 5.67 MB
Statistics
  • Stars: 8
  • Watchers: 6
  • Forks: 1
  • Open Issues: 2
  • Releases: 0
Created over 2 years ago · Last pushed 7 months ago
Metadata Files
Readme License Citation Support

README.md

Plastics Prototype

Prototype for the plastics decision support tool with transparent intervention code / authoring. The tool is primarily available at https://global-plastics-tool.org/. This tool is in pre-release (like preprint), feedback welcome!


Related

See also source code for "main" pipeline and source code for the GHG pipeline. Further documentation for this effort can be found in our supplemental scripts and documentation repositories. This final repository produces the following documentation chapters:


Purpose

This tool allows users to explore potential future plastic outcomes including waste and consumption under different policy scenarios. It does this primarily through an interactive browser-based tool but also offers some static visualizations and the ability to run these policy scenarios through Node outside the browser. Altogther, this tool provides new perspective to policy makers and other stakeholders on how to address global plastic waste, hoping to help inform efforts such as UN INC on Plastic Pollution.


Usage

There are multiple ways to interact with the tool. Note that many of these require pt/index.json rendered via support/render_index.py.

In-browser

The primary way to interact with the tool is through the browser. See https://global-plastics-tool.org/ for the publicly available hosted version. To host it yourself or run it on your own machine, see the instructions below.

Command line

The policy simulation engine can also run externally to the browswer through Node. See js_standlaone for more details.

Writing new interventions

See the pt subdirectory (pt) for more details on how to add new interventions.


Modeling

Note that the model repository including data and source code is available at https://github.com/SchmidtDSE/plastics-pipeline.


Container Environment

A containerized environment is available for both local execution of the application as well as development.

Containerized execution

The application can be run through a Docker container. This will build the application as well as generate the static supporting graphs and selected static scenario outputs.

Containerized development

Note that a containerized cloud development environment is also available. See .gitpod.yml and GitPod for more details. After opening the repository, start running the application with python -m http.server.


Manual Environment

To run the tool locally with a custom or manual environment setup, some prerequisites are required:

  • Java allows for ANTLR source generation as required for the plastics intervention language.
  • Node is required in order to run grunt and webpack, enabling preparation of the front-end.
  • Python acts as automation scripting.

Having installed the above, execute the following to start the local server:

  • Install Python dependencies: pip install -r requirements.txt.
  • Setup the local environment with bash support/setup_local.sh which includes downloading a copy of the underlying data.
  • Execute a local web server for example python -m http.server.

Note that optional static visualizations are also available under image_gen. See that sub-directory's README for more details.


Deployment

There are two options for deploying the application.

CI / CD

CI / CD can deploy changes after they merge to deploy, releasing to the public version. Note that this tool does not have a backend and the contents of this repository simply need to be hosted as static files after building (see support/setup_local.sh for a minimal build).

Container

The Docker container can also be deployed to various different environments. By default, it will use nginx to host the static files on port 8080 but this may require port forwarding in your hosting environment. Furthermore, it does not run in a daemon. Please adjust Dockerfile and docker-compose.yml to fit your desired secuirty profile and hosting environment before deployment.


Development standards

This project uses the following:

  • Primarily, front-end tests are supported through Grunt (grunt) and QUnit. Meanwhile style is generally enforced eslint (npx eslint ./js/*.js).
  • Note that CI / CD may execute other tests and all pull requests should be passing all test and lint operations before merge.
  • When in doubt, please follow the JavaScript Style Guide.
  • Try to provide docstrings / JSDoc for public members (note that the support directory is excluded from this requirement at this time).
  • Reviewers may also impose certain requirements around usability and accessibility as to be discussed during reviews.

Please be kind. Open source is an act of love.


Data and Citation

Please cite Pottinger et al 2024. Thank you! This tool's other repositories use the following:

We thank the community and authors for their contribution.


Open source

The project uses the following:

Note that the following may be invoked as executables like via the command line through CI / CD or by users of this tool but are not statically linked with the tool (and are not used during the execution of the web-based interactive tool):

Our CI / CD systems via GitHub Actions also use the libraries described in build.yml.

Meanwhile, the optional containerized environment uses the following:

Finally, thanks to the following some basic boilerplates / inspiration:

Note that additional open source libraries used by the model pipeline are discussed at https://github.com/SchmidtDSE/plastics-pipeline.


Retrospectives

As an open source project, we record major security or reliability incidents publicly. We have 1 report to mention: we had a near-miss as described in 20250611-GlobalPlasticsTool-Polyfill in which we do not believe users were impacted.

Owner

  • Name: DSE
  • Login: SchmidtDSE
  • Kind: organization
  • Email: dse@berkeley.edu
  • Location: United States of America

The Eric and Wendy Schmidt Center for Data Science & Environment at Berkeley

Citation (CITATION.cff)

cff-version: '1.1.0'
message: 'Please cite the following works to reference this software.'
abstract: 'This multi-disciplinary case study details how a public web application combines information and game design to visualize effects of user-defined policies intended to reduce plastic waste. Contextualizing this open source software within a broader lineage of digital media research, this user experience exploration outlines potential directions for facilitating conversation between artificial intelligence, scientists, and decision makers during an iterative policy building process. Furthermore, this system dissection reveals how this interactive science effort considers the practicalities of a treaty''s shifting priorities and proposals in its designs. Specifically, this historically situated investigation of the tool''s approach highlights options for centering human decision making where artificial intelligence helps reason about interventions but does not prescribe them. Finally, analysis summarizes this application''s specific game design-inspired mechanics and their efforts to: enable users'' agency to explore solution possibilities freely, invite deep engagement with scientific findings, and simultaneously serve multiple audiences with divergent objectives and expertise.'
authors:
  - family-names: 'Pottinger'
    given-names: 'A Samuel'
  - family-names: 'Biyani'
    given-names: 'Nivedita'
  - family-names: 'Geyer'
    given-names: 'Roland'
  - family-names: 'McCauley'
    given-names: 'Douglas J'
  - family-names: 'de Bruyn'
    given-names: 'Magali'
  - family-names: 'Morse'
    given-names: 'Molly R'
  - family-names: 'Nathan'
    given-names: 'Neil'
  - family-names: 'Koy'
    given-names: 'Kevin'
  - family-names: 'Martinez'
    given-names: 'Ciera'
doi: '10.48550/ARXIV.2312.11359'
identifiers:
  - type: 'doi'
    value: '10.48550/ARXIV.2312.11359'
  - type: 'url'
    value: 'https://arxiv.org/abs/2312.11359'
title: 'Combining Game Design and Data Visualization to Inform Plastics Policy: Fostering Collaboration between Science, Decision-Makers, and Artificial Intelligence'
url: 'https://arxiv.org/abs/2312.11359'
version: '2'

GitHub Events

Total
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 16
  • Pull request event: 18
  • Create event: 5
Last Year
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 16
  • Pull request event: 18
  • Create event: 5

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 1,189
  • Total Committers: 3
  • Avg Commits per committer: 396.333
  • Development Distribution Score (DDS): 0.002
Past Year
  • Commits: 136
  • Committers: 1
  • Avg Commits per committer: 136.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
A Samuel Pottinger s****m@g****g 1,187
dependabot[bot] 4****] 1
Magali de Bruyn d****n@b****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 174
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.02
  • Merged pull requests: 167
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 52
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.02
  • Merged pull requests: 49
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • sampottinger (4)
Pull Request Authors
  • sampottinger (323)
  • dependabot[bot] (2)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels
dependencies (2)

Dependencies

.github/workflows/build.yaml actions
  • Creepios/sftp-action v1.0.3 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-java v3 composite
  • actions/setup-node v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
.github/workflows/build_trigger.yaml actions
  • Creepios/sftp-action v1.0.3 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-java v3 composite
  • actions/setup-node v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
Dockerfile docker
  • ubuntu jammy-20230916 build
docker-compose.yml docker
  • globalplasticstool latest
js_standalone/package.json npm
  • @babel/core ^7.16.5 development
  • @babel/plugin-proposal-class-properties ^7.16.5 development
  • @babel/preset-env ^7.16.5 development
  • babel-loader ^9.1.2 development
  • eslint ^8.44.0 development
  • eslint-config-google ^0.14.0 development
  • antlr4 ^4.13.0
  • handlebars ^4.7.8
  • package.json ^0.0.0
  • papaparse ^5.4.1
package.json npm
  • @babel/core ^7.16.5 development
  • @babel/plugin-proposal-class-properties ^7.16.5 development
  • @babel/preset-env ^7.16.5 development
  • babel-loader ^9.1.2 development
  • eslint ^8.44.0 development
  • eslint-config-google ^0.14.0 development
  • webpack ^5.65.0 development
  • webpack-cli ^4.9.1 development
  • antlr4 ^4.13.0
  • grunt ^1.5.2
  • grunt-contrib-connect ^3.0.0
  • grunt-contrib-qunit ^6.1.0
  • package.json ^0.0.0
requirements.txt pypi
  • matplotlib ==3.8.0
  • pandas ==2.1.1