Skip to content
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

Add fully-functional ParameterNode.__repr__ #274

Open
nikhilwoodruff opened this issue Sep 19, 2024 · 1 comment · May be fixed by #295
Open

Add fully-functional ParameterNode.__repr__ #274

nikhilwoodruff opened this issue Sep 19, 2024 · 1 comment · May be fixed by #295
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@nikhilwoodruff
Copy link
Contributor

Currently we read in parameters from YAML files, and calling print on a loaded ParameterNode (which often represents a single YAML file) will print out some of the original YAML read in. But a hugely impactful feature would be to have str(parameter_node) be exactly equal to the original YAML file (or better, with some sorting of keys).

This could cut runtimes in the US significantly, because currently we run lots of operations on the parameter nodes at load time (making parameter breakdowns uniform, adding missing US state values, etc.). If we could easily print out the YAML file versions of parameters we've applied these operations too, we could just commit them to the codebase and remove the need for these operations at runtime.

@nikhilwoodruff nikhilwoodruff added enhancement New feature or request help wanted Extra attention is needed labels Sep 19, 2024
@nikhilwoodruff
Copy link
Contributor Author

We should then test that this works for the root node of the UK and US systems.

@SylviaDu99 SylviaDu99 self-assigned this Oct 15, 2024
SylviaDu99 added a commit to SylviaDu99/policyengine-core that referenced this issue Oct 15, 2024
SylviaDu99 added a commit to SylviaDu99/policyengine-core that referenced this issue Oct 16, 2024
@SylviaDu99 SylviaDu99 linked a pull request Oct 16, 2024 that will close this issue
SylviaDu99 added a commit to SylviaDu99/policyengine-core that referenced this issue Oct 16, 2024
SylviaDu99 added a commit to SylviaDu99/policyengine-core that referenced this issue Oct 28, 2024
SylviaDu99 added a commit to SylviaDu99/policyengine-core that referenced this issue Oct 30, 2024
…es in dictionary form; write_yaml in ParameterNode class now do most of the job

WIP

fixes: PolicyEngine#274
SylviaDu99 added a commit to SylviaDu99/policyengine-core that referenced this issue Nov 12, 2024
SylviaDu99 added a commit to SylviaDu99/policyengine-core that referenced this issue Nov 23, 2024
SylviaDu99 added a commit to SylviaDu99/policyengine-core that referenced this issue Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants