-
Notifications
You must be signed in to change notification settings - Fork 31
Prepare for jitting / vectorization of GETTSIM #891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare for jitting / vectorization of GETTSIM #891
Conversation
…n.to_source. In limited set of experiments, it produced exactly the same result.
…g tests. Fix typing and some isinstance checks.
…d_transfers.py'. Fails.
… will do in the office where I had merged things but not pushed.
…-economics/gettsim into vectorize-mettsim
…h 'loop' where necessary.
|
Update: I changed the default of What I did not realise until recently is that |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## collect-components-of-namespaces #891 +/- ##
=====================================================================
- Coverage 83.57% 69.69% -13.88%
=====================================================================
Files 147 147
Lines 5704 5702 -2
=====================================================================
- Hits 4767 3974 -793
- Misses 937 1728 +791 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MImmesberger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic of calculating IDs beforehand and calculate the rest of the DAG afterwards fails for stuff like bg_id and wthh_id. Their dependencies consist basically of almost the entire DAG. (That's probably what you meant, I just want to make sure we're one the same page). So users would not get speed benefit if their data is large, but only if they want to call GETTSIM repeatedly on the same (stable - with respect to BD and WTHH) household constellation.
| @@ -51,7 +56,7 @@ def __init__( | |||
| date: datetime.date, | |||
| ) -> None: | |||
| self.info = info | |||
| self.input_tree = input_tree | |||
| self.input_tree = optree.tree_map(np.array, input_tree) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't we want np.array([1, 2, 3]) instead of [np.array(1), np.array(2), np.array(3)] here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what happens in my book 😉
(Pdb+) input_tree
{
'alter':
0 67
1 34
2 37
3 48
dtype: int64,
...
}
(Pdb+) self.input_tree
{'alter': array([67, 34, 37, 48]), ... }
And yes, I'd think that will be a fairly common use case. And of course, one could do 3+ calls of GETTSIM; just that we can't / probably don't want to bake that into |
d9248f9
into
collect-components-of-namespaces
What problem do you want to solve?
A brief shot at trying to do the same for GETTSIM what #879 did for METTSIM.
test_full_taxes_and_transfersruns nicely!Einkommensteuertests may require calculation ofsn_id, but won't have all inputs required forbg_id).Solving this should be doable (first set up the entire graph, then check which ids are needed), but the required functions are buried inside of
compute_taxes_and_transfersso we should not waste time on that before implementing the new interface.