Open
Conversation
*Not ready to merge* In filing PSLmodels#323 I looked through this file, and took a stab at streamlining the code. Changes include: 1. Using a `wage_bin` function to create wage bins. 2. Using a loop to assign `lhs_vars` dictionary elements.* 3. Using a loop to assign factor variables. 4. Using an `add_target` function to assign `rhs_vars` dictionary elements.* 5. More explicitly adjust `model_vars` for year 2014. 6. Rename `LP` to `lp` since it's not a constant. 7. Other minor changes like comments. \* These pieces won't currently work since they attempt to access `globals()` from within a function (`locals()` also won't work). Per https://stackoverflow.com/q/56983782/1840471, there's no good way to access these, and this is really a sign that something could be done better. It seems to me that sticking with the dictionary elements rather than creating new variables would be a clean alternative. I haven't tested this code yet. Would the right way be to run `make cps-files`?
Collaborator
|
Thanks for working on this, @MaxGhenis! These changes look good so far.
Yes. Once you run this it'll create a new weights file and you can see if the results have changed at all. Fair warning, this will take a few hours to run. |
Contributor
Author
|
Sorry I've left this open so long. I'll resolve conflicts, boil it down to the basics, and test it, once #343 is merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not ready to merge
In filing #323 I looked through this file, and took a stab at streamlining the code. Changes include:
wage_binfunction to create wage bins.lhs_varsdictionary elements.*add_targetfunction to assignrhs_varsdictionary elements.*model_varsfor year 2014.LPtolpsince it's not a constant.* These pieces won't currently work since they attempt to access
globals()from within a function (locals()also won't work). Per https://stackoverflow.com/q/56983782/1840471, there's no good way to access these in-between-scoped variables, and this is really a sign that something could be done better. It seems to me that sticking with the dictionary elements rather than creating new variables would be a clean alternative.I haven't tested this code yet. Would the right way be to run
make cps-files?