-
Notifications
You must be signed in to change notification settings - Fork 34
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
Namespaces: Infrastructure #780
base: collect-components-of-namespaces
Are you sure you want to change the base?
Conversation
@MImmesberger The nested function dictionary is currently structured like this: Which levels of nesting should be removed? Based on our previous discussion, it's probably the first two, i.e. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## collect-components-of-namespaces #780 +/- ##
===================================================================
Coverage ? 48.77%
===================================================================
Files ? 55
Lines ? 4012
Branches ? 0
===================================================================
Hits ? 1957
Misses ? 2055
Partials ? 0 ☔ View full report in Codecov by Sentry. |
I think that, for example, |
Looking at that, I'd almost think that What do you think, @MImmesberger ? In any case, not super-important for the moment, the good thing is that it will be fairly easy to do bulk-renamings / removals (granted it seems more difficult to insert a level back than to remove it, so I'd be fine with an approach applying a bit more caution at the moment). |
I agree, there should be no overlap between the elements one level below the Regarding the naming of |
Agreed, let's use I'm all for good docstrings, but any tax deduction should go into the tax component it is deducted from, right? |
Yes definitely. Was just thinking about making it as obvious as possible. In our case "Kinderbonus" is a transfer. |
More in line with the naming of modules might be |
Good catch! Those are scheduled to be changed to
But that was not impossible to know, ofc! |
Should the renamings/removals be done programmatically in the new function or by changing the directory structure under Edit: For now, remove |
Just came across #533 -- might that be fixed in passing here? |
for more information, see https://pre-commit.ci
- Add testing dependencies to default environment - Make sure the correct kaleido dependency is installed on Windows/Unix - Add task `tests`, so that `pixi run tests` gives one the option to run the tests on Python 3.11 and 3.12 - Set 3.12 as the upper bound for the default environment Python version (as long as we don't test 3.13, we should probably not use it in the development environment?). - Use pdbp in pytest - Remove artifacts from previous packaging workflow --------- Co-authored-by: Hans-Martin von Gaudecker <[email protected]>
…ut data of concatenated function.
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.
Excellent! Some very small comments left, no show-stoppers though.
I don't have a good intuition about the extent to which we should rely on i) One obvious candidate for the unflattening functionality of ii) In the other cases, we never really unflatten in the However, if we don't want to touch (ii), I would vote against using |
Yes, let's use it then. It is a dependency, anyhow, via dags. As discussed there -- easy enough to emulate should need arise.
I think it would be much clearer there if we did something like this untested snippet: ref_paths = set(flatten_dict.flatten(tree_to_partition).keys())
flat = flatten_dict.flatten(tree_to_partition)
intersection = flatten_dict.unflatten({p: l for p, l in flat.items() if p in ref_paths})
difference = flatten_dict.unflatten({p: l for p, l in flat.items() if p not in ref_paths})
If this was done forever at this point, I would agree. However, it is more about the precedent. Let's not rewrite functions again. |
…update docstring.
We use |
Excellent, thanks! Just had a brief look on the phone — why do you go back to qualified names? flatten would just return the tree path we need, no? |
Yes, in some places we need the qualified name, in other places we could use the qualified name or the path (just doesn't matter there). I thought that consistency would be nice, i.e. knowing that an object flattened by But if you disagree, I can easily change that. |
As far as I can tell, the only unresolved issue are the function attributes of I will create an issue for that such that we can tackle it later. Edit: Also, Github Actions fails and I can't make sense of it. Can you have a look? |
What problem do you want to solve?
This PR introduces namespaces to GETTSIM's infrastructure.
policy_function
decorator (renamepolicy_info
and change behavior so that aPolicyFunction
instance is returned).Apply to all TT functions.(that should be part of renamings)__init__.py
).