policyengine / policyengine-uk-old Goto Github PK
View Code? Open in Web Editor NEWSource code for PolicyEngine-UK
Home Page: https://uk.policyengine.org
Source code for PolicyEngine-UK
Home Page: https://uk.policyengine.org
See also #26
Users found this very confusing. Can always bring it back with an "add family" button but unnecessary for now IMO.
e.g. for UC
Neither http://www.policyengine.org nor https://www.policyengine.org redirect appropriately
It seems GitHub pages doesn't work with the routing method used in the React App, and instead requires a HashRouter to be used (/#/population-results?..., rather than /population-results?). Without this, users currently can't just paste in links as the query parameter parsing doesn't work right now (though it does locally, just not on hosted GH pages).
(I'm assuming)
e.g. I got confused why the UBI element was zero when I added a UBI, before realizing it's the baseline by default
Plotly has a bug such that changing the default selection doesn't change the data: plotly/plotly.py#3276
It could be set to play automatically, but that looks to be an html export thing rather than json: plotly/plotly.py#3332
Here's what I did:
Simulate on the population
See your results
Then it spins for 10 seconds and gives an empty screen.
Refreshing the page (https://uk.policyengine.org/situation-results?child_UBI=10) shows this error:
I'd suggest changing the title from UK Policy Engine by the UBI Center
to PolicyEngineUK
(subscript UK), like the slides
Then if there's social stuff and the UBI Center logo elsewhere e.g. upper right (#46) I think we can remove the UBI Center part.
I'm up to date on openfisca-uk
, might I need to install or update something else?
(base) mghenis@penguin:~/nikhilwoodruff/openfisca-uk-ui$ export FLASK_APP=server/server.py
(base) mghenis@penguin:~/nikhilwoodruff/openfisca-uk-ui$ flask run
* Serving Flask app "server/server.py"
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Traceback (most recent call last):
File "/home/mghenis/anaconda3/bin/flask", line 10, in <module>
sys.exit(main())
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 967, in main
cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 848, in run_command
app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 305, in __init__
self._load_unlocked()
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 330, in _load_unlocked
self._app = rv = self.loader()
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 388, in load_app
app = locate_app(self, import_name, name)
File "/home/mghenis/anaconda3/lib/python3.7/site-packages/flask/cli.py", line 240, in locate_app
__import__(module_name)
File "/home/mghenis/nikhilwoodruff/openfisca-uk-ui/server/server.py", line 26, in <module>
baseline = openfisca_uk.Microsimulation()
File "/home/mghenis/PSLmodels/openfisca-uk/openfisca_uk/tools/simulation.py", line 219, in __init__
self.year = max(dataset().years)
ValueError: max() arg is an empty sequence
The existing slider-waterfall is useful, but I think the first thing the user sees should mirror the first thing in the population graph: a decomposition of changes. This chart could be hidden if the policy reform doesn't affect them.
This would also make the default slider value issue in #71 less important if that becomes challenging.
e.g.
© 2021 The UBI Center. Let us know what you think! Email [email protected] or file an issue on GitHub.
Trying to guess a budget-neutral policy and then correcting is at least for me a very common use-case. It would save both the user and server time if we can avoid this double-usage.
Skipping the household info page
The description is currently long and refers to stuff that users might not need to know, like OpenFisca (I think the disclaimers at the results page are the right place for this):
Welcome to the UBI Center's UK Policy Engine. Powered by the open-source microsimulation model OpenFisca-UK, this site allows you to experiment with different changes to how taxes and benefits are set in the United Kingdom, and simulate the results on people, families and households in the country.
I think the four numbers actually describe it well. Could we see what it looks like if that takes up the whole first row, with no description?
The max is currently 200k regardless of income. How about max(200k, income*2)
? So for high earners the you are here
dot (#59) will be centered.
Users found it hard to understand how to add a child, since adding people only adds adults, until you change their age.
How about instead, the family overview tab asks (a) marital status (adds spouse if married) and (b) # kids. An adult record for family head is always present, but named "Head" instead of "Adult 1".
We might want a different page later on, e.g. with a form to request PolicyEngine in your country, but just redirect for ease right now
e.g. from my experience, also needs notes on:
export HOST=localhost
openfisca-uk-data frs save ~/frs_2018.h5 2018
npm start
has to be in a separate terminalsudo npm install -g serve
and serve -s build
Not functional at the moment because in-memory caches are going to get wiped at every restart/not shared between multiple instances if demand is high
http://policyengine.org and http://uk.policyengine.org redirect appropriately to https://uk.policyengine.org, but https://policyengine.org doesn't.
With a little UBI Center logo?
I just updated openfisca-uk, and followed the instructions to run:
(base) mghenis@penguin:~/nikhilwoodruff/openfisca-uk-ui$ export FLASK_APP=server/server.py
(base) mghenis@penguin:~/nikhilwoodruff/openfisca-uk-ui$ flask run
* Serving Flask app "server/server.py"
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Usage: flask run [OPTIONS]
Error: Could not import "server".
To align with openfisca-uk and og-uk, and the app itself
Potentially also link to other benefit calculators
For some reason, the site only works in incognito. I suspect this is because of how we're directing requests to the static site using a 404 handler; that this is causing the browser to think static site requests are all the index.html, caching it and using the index.html file in place of static resources improperly.
missing
So that net cost stands out. Alternatively, lighten the columns other than net cost.
Benefits, add them back later
Upper right? Footer? Something also with the UBI Center full logo and link to ubicenter.org
It's currently set to 30% because of a memory error
Here's what the summary statistics at the top currently look like:
This highlights the numbers well, but has a couple drawbacks IMO:
An alternative could be writing out the takeaways. Here's my shot at this (Figma):
This is still awkward in a couple ways:
But I think it could be quicker for users to absorb.
Users currently navigate in two parts of the screen:
This was intended to act like a shopping cart flow, but given the multiple screens, I think we could streamline the interface by combining the progress tracking and navigation buttons.
Here's an example (I'm sure there's a more Ant-Designy way of doing it, especially the black to show the active screen), from the first screen (Figma):
This also reduces the amount of text, which I think is made unnecessary by the action-oriented buttons. Here's how they could all look:
@nikhilwoodruff I'm curious what you think.
While we're waiting on further information as to how to host the server, we can host the client on GH pages
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.