Comments (7)
Happy to investigate this over the coming week
from policyengine-api.
Thanks @anth-volk!
from policyengine-api.
Hey @nikhilwoodruff, I've been going through the API trying to figure out this issue, and I'm wondering if it traces back to policyengine-core or one of the country packages. On line 15 of the api package's single_economy.py (here), do you know what the source of the gini()
method is? I can't seem to find a definition in the Simulation
class definition in policyengine-core, the calculate()
(or _calculate()
) methods in the same package, or the equiv_household_net_income
variable definition in policyengine-us or policyengine-uk. I also didn't see it defined in the numpy docs anywhere.
from policyengine-api.
Hey @anth-volk - yes this is a little cryptic and we should probably add more type hints. But if you follow the Microsimulation.calculate
function to its definition in policyengine-core
, it actually returns a microdf.MicroSeries
instance (definition for MicroSeries.gini
here).
That said, I haven't actually seen this error come up recently- my guess is that it's caused by some of the household net incomes being None
which would cause the gini
function to blow up. We did have an issue with that in policyengine-us
a while ago, but AFAICT it's been fixed. So I think we could close this unless you've been able to reproduce it recently? (sorry for the effort on your part if so!)
from policyengine-api.
Ah, thank you for the details @nikhilwoodruf , I suppose I should've followed the "paper trail" a bit more. Due to the installation issues I told you about in Slack, I've actually yet to get to test whether or not I could reproduce the issue. If you'd like, once I can get a local install up and running, I could test and see if I can reproduce it, but also if you feel confident enough, perhaps we could close? Sorry for all the installation issues on my end.
from policyengine-api.
Hey @nikhilwoodruff, I've yet to reproduce this bug. Maybe it would be worthwhile to close until it resurfaces?
from policyengine-api.
Thanks, yep closing.
from policyengine-api.
Related Issues (20)
- POST requests to /{country_id}/household return 200s instead of 201s HOT 2
- Add .yaml extension to tests/api/test_get_search_malformed_country_id
- Dependency conflict with Python 3.10
- Don't require output variables in household definitions HOT 2
- Error with NYC household HOT 1
- Unable to run make test locally
- Save GPT analysis results to database
- Profiling debugging is slow due to JSON pretty-print HOT 1
- API endpoint for LLM Q&A
- No local db records to enable testing on data present in the remote db
- get_analysis returns 500 when record doesn't exist
- Redeploy automatically every ~day
- State taxes are no longer static at federal model views HOT 2
- Rename `nj_child_tax_credit` to `nj_ctc` in tests
- Add missing states to country.py
- Inconsistent decile and inequality impacts HOT 2
- Marginal tax rate difference doesn't work with a custom baseline HOT 1
- make lint requires Black 23.7.0, but installing locally requires Black < 23 due to requirements of policyengine-canada HOT 1
- Clear out duplicate policies
- A subset of old households contain an "axes" value that breaks the application
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from policyengine-api.