-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Load built-in reform file from within taxcalc package #1644
Comments
@MaxGhenis asked:
Thanks for your interest in Tax-Calculator. The short answer to your question is no. If you want to work locally you have several options all of which involve downloading the JSON reform file to your computer:
We're working to fix the other problems you identified. Thanks for the bug reports. |
I am giving this an enhancement label. The merits of the enhancement should still be considered. |
@andersonfrailey and @hdoupe, Can you explain exactly what users have been asking for? How are they using Tax-Calculator? They must not have the source code because all the JSON reform files are included with the source code. |
@martinholmer what they want is a way to work only with the taxcalc package to access the JSON files. Basically for something like this: from taxcalc.reforms import TCJA_Senate
.
.
.
policy.implement_reform(TCJA_Senate) |
|
@MattHJensen , Have any CLI users actually asked for this feature? |
Not that I know of. @andersonfrailey, have any of the users who have asked you been using the CLI as opposed to the python API? |
No. Everyone I've talked to is using the API. |
@MattHJensen said about issue #1644:
Yes, I agree we should weigh the benefits for users against the costs for users and developers. I'll discuss the benefits and costs below, but you'll see that in my mind the net benefit of this enhancement is a large negative (that is, benefits are small while costs are large). So, I'm not in favor of pursuing this enhancement. This issue was raised by @MaxGhenis, who on November 9th asked this question:
Benefits
Costs
In summary, it's been almost seven weeks since this issue was raised. During that period many users have been using What do other developers think? Are there other benefits I don't see that would significantly change the benefit-cost balance? |
When I suggested this, I had thought that Could an alternative be a function that loads reform files by pulling them down from Github itself? Or is there a way to do this today? I also agree the time-saving benefits are minor. I'd consider the benefits more around reproducibility (it's more clear what reform was used by the analyst and that it wasn't modified) and "cloud-orientation" (it just seems a bit cleaner to avoid reliance on local files, especially as cloud notebooks become more popular). |
On Tue, 19 Dec 2017, Max Ghenis wrote:
When I suggested this, I had thought that taxcalc already included all the
reform files somewhere hidden. Since it sounds like this is not the case, I
agree that a function to load reforms within the package wouldn't make as
much sense, especially given @martinholmer's [Cost item] 2 (making
reforms quickly available).
Could an alternative be a function that loads reform files by pulling them
down from Github itself? Or is there a way to do this today?
This isn't my strength, but doesn't Python have rather easy ways to fetch
a file via http? Perhaps called Lib/urllib/request.py?
dan
|
Yes, but However, I haven't been able to load the JSON file (see this notebook):
produces this error:
I wonder if this might relate to the comments, so will try with a file without comments soon. |
Removing the comments worked:
This makes sense per https://stackoverflow.com/a/4183018/1840471:
NB:
This addresses my issue, so feel free to close. Or if there's interest, it could be useful to check if the strings are URLs, and if so to apply the above reader. I could give this a shot. |
@MaxGhenis said:
I'm going to accept your invitation to close #1644 because the conversation is being continued in #1777. |
Does
taxcalc
have a way to load built-in reform files (e.g. TCJA) directly? So far I've downloaded the file locally, then loaded it usingcalc_x.read_json_param_objects
, e.g. as in[5]
of the training notebook.The text was updated successfully, but these errors were encountered: