ubicenter / us-calc Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
In include in UBI
Requires dev work in http://github.com/nikhilwoodruff/openfisca-us
It's hard to read on mobile right now
Into data/raw/
and data/processed/
folders
doesn't need to be in this pr but these string pieces could be simplified with a function
Originally posted by @MaxGhenis in #62 (comment)
I assume this is for people with disabilities?
Currently a bunch of preprocessing happens every time the app loads. Do this in advance for speed.
And mention that it's monthly (it's currently annual but doesn't say so)
To condense these if
statements:
Lines 214 to 236 in 36e9e34
This would also clear up some potentially confusing results like this (California state level, 1% flat tax, excludes adults (i.e. child allowance)). So White Non-Hispanic, Black Non-Hispanic, Hispanic, Other Non-Hispanic. Presumably the Other Non Hispanic group has a higher poverty impact than the others, bringing the overall poverty impact to 9.2%.
Customize the hover charts so that it shows the original number and the change. Not sure how to do this on bar charts yet. without adding each bar separately.
Currently they're in an iframe so they don't open. See Peter-Metz/ccc-widget#1 (comment)
The html.A
object has a target
kwarg that should be set to "blank"
here:
Line 473 in ff7dcb0
Condense this section:
Lines 18 to 55 in 36e9e34
These are probably slowing down the function
Make the actual Dash app look better. Probably the final step.
Currently causing an off-by-100 error, and confusing. Instead keep everything as 0-1 proportions, and use fig.update_layout(yaxis_tickformat="%")
instead of suffix="%"
to show proportions as proper percentages.
https://dashboard.heroku.com/apps/us-ubi-calculator/logs
Nothing is very big here, the CPS file is about 10MB.
2021-01-28T21:17:42.597570+00:00 heroku[web.1]: State changed from crashed to starting
2021-01-28T21:17:56.928860+00:00 heroku[web.1]: Starting process with command `gunicorn funding:server`
2021-01-28T21:18:00.301970+00:00 app[web.1]: [2021-01-28 21:18:00 +0000] [4] [INFO] Starting gunicorn 20.0.4
2021-01-28T21:18:00.303024+00:00 app[web.1]: [2021-01-28 21:18:00 +0000] [4] [INFO] Listening at: http://0.0.0.0:56215 (4)
2021-01-28T21:18:00.303180+00:00 app[web.1]: [2021-01-28 21:18:00 +0000] [4] [INFO] Using worker: sync
2021-01-28T21:18:00.310506+00:00 app[web.1]: [2021-01-28 21:18:00 +0000] [10] [INFO] Booting worker with pid: 10
2021-01-28T21:18:00.348731+00:00 app[web.1]: [2021-01-28 21:18:00 +0000] [11] [INFO] Booting worker with pid: 11
2021-01-28T21:18:01.396240+00:00 heroku[web.1]: State changed from starting to up
2021-01-28T21:18:16.246762+00:00 heroku[web.1]: Process running mem=592M(115.8%)
2021-01-28T21:18:16.248864+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2021-01-28T21:18:31.597593+00:00 app[web.1]: [2021-01-28 21:18:31 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:10)
2021-01-28T21:18:31.602269+00:00 app[web.1]: [2021-01-28 21:18:31 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:11)
2021-01-28T21:18:31.746444+00:00 app[web.1]: [2021-01-28 21:18:31 +0000] [10] [INFO] Worker exiting (pid: 10)
2021-01-28T21:18:31.786460+00:00 app[web.1]: [2021-01-28 21:18:31 +0000] [11] [INFO] Worker exiting (pid: 11)
2021-01-28T21:18:32.705257+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=us-ubi-calculator.herokuapp.com request_id=31a11c22-1469-4b03-8d06-26a06a26690b fwd="47.155.227.254" dyno=web.1 connect=0ms service=30001ms status=503 bytes=0 protocol=https
2021-01-28T21:18:32.728554+00:00 app[web.1]: [2021-01-28 21:18:32 +0000] [48] [INFO] Booting worker with pid: 48
2021-01-28T21:18:32.798500+00:00 app[web.1]: [2021-01-28 21:18:32 +0000] [49] [INFO] Booting worker with pid: 49
2021-01-28T21:18:34.151024+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=us-ubi-calculator.herokuapp.com request_id=d6767ec4-5a3e-4f0d-98fd-fc4d3f948603 fwd="76.21.110.99" dyno=web.1 connect=5000ms service=30001ms status=503 bytes=0 protocol=https
2021-01-28T21:18:57.136725+00:00 heroku[web.1]: Process running mem=971M(189.8%)
2021-01-28T21:18:57.139495+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2021-01-28T21:19:03.068085+00:00 app[web.1]: [2021-01-28 21:19:03 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:48)
2021-01-28T21:19:03.070676+00:00 app[web.1]: [2021-01-28 21:19:03 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:49)
2021-01-28T21:19:03.168249+00:00 app[web.1]: [2021-01-28 21:19:03 +0000] [49] [INFO] Worker exiting (pid: 49)
2021-01-28T21:19:03.182359+00:00 app[web.1]: [2021-01-28 21:19:03 +0000] [48] [INFO] Worker exiting (pid: 48)
2021-01-28T21:19:04.131108+00:00 app[web.1]: [2021-01-28 21:19:04 +0000] [80] [INFO] Booting worker with pid: 80
2021-01-28T21:19:04.187324+00:00 app[web.1]: [2021-01-28 21:19:04 +0000] [81] [INFO] Booting worker with pid: 81
2021-01-28T21:19:18.384942+00:00 heroku[web.1]: Process running mem=651M(127.3%)
2021-01-28T21:19:18.387169+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2021-01-28T21:19:34.477825+00:00 app[web.1]: [2021-01-28 21:19:34 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:80)
2021-01-28T21:19:34.501329+00:00 app[web.1]: [2021-01-28 21:19:34 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:81)
2021-01-28T21:19:34.585942+00:00 app[web.1]: [2021-01-28 21:19:34 +0000] [81] [INFO] Worker exiting (pid: 81)
2021-01-28T21:19:34.590370+00:00 app[web.1]: [2021-01-28 21:19:34 +0000] [80] [INFO] Worker exiting (pid: 80)
2021-01-28T21:19:35.616296+00:00 app[web.1]: [2021-01-28 21:19:35 +0000] [112] [INFO] Booting worker with pid: 112
2021-01-28T21:19:35.702181+00:00 app[web.1]: [2021-01-28 21:19:35 +0000] [113] [INFO] Booting worker with pid: 113
2021-01-28T21:20:00.144148+00:00 heroku[web.1]: Process running mem=1088M(212.6%)
2021-01-28T21:20:00.146071+00:00 heroku[web.1]: Error R15 (Memory quota vastly exceeded)
2021-01-28T21:20:00.147704+00:00 heroku[web.1]: Stopping process with SIGKILL
2021-01-28T21:20:00.361480+00:00 heroku[web.1]: Process exited with status 137
2021-01-28T21:20:00.402385+00:00 heroku[web.1]: State changed from up to crashed
For every geo/metric combo, or maybe structured as geo/group/metric/value, i.e. CA | child | deep_poverty | 0.21
Save as a CSV
Suggested flow:
See e.g. this will produce the incorrect result since taxes are by person but liabilities affect the full SPM unit:
Lines 238 to 240 in 36e9e34
Replace Explore funding mechanisms of UBI
Required to run locally
Min and max age, so e.g. we could do an 18+ UBI or an under-6 or under-18
https://blog.ubicenter.org/20201230/us-flat-tax.html
Probably due to #20
Currently the dicts mapping data column names to printed names are in there three times. Would be good to refactor.
As @ngpsu22 mentioned
Currently loads from the GitHub URL, should be able to do locally to save some time
Lines 13 to 14 in 84817f4
Currently using https://github.com/UBICenter/blog/raw/master/jb/_static/ubi_center_logo_wide_blue.png:
Which previews (per https://cards-dev.twitter.com/validator) cut off:
I can update at https://compute.studio/UBICenter/us-ubi-calc/settings/
Also validate at https://developers.facebook.com/tools/debug/
Could be tricky since it includes state and federal funding, would have to claw back the MOE to fund UBI
And pre-check all boxes, I think this would be clearer
It's pretty slow on Heroku: http://us-ubi-calculator.herokuapp.com/
@hdoupe shared these instructions: https://docs.compute.studio/publish/data-viz/guide.html
Currently shows the UBI amount, would be good to have the numerator and denominator
e.g. ASEC 2017-2019
Net resources does not change for US at federal level and all states at state level.
Create a data/
folder with a .py
script and the raw data as a csv.
@hdoupe could you please update this app on CS? We've made a few changes and we're presenting it at a conference on Saturday.
Connotes replacing the existing progressive tax code when that isn't necessarily what it does
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.