Currently, any value of OPTIMIZE_IPRINT other than 0 shows every iteration. Instead, it should show every OPTIMIZE_IPRINT iteration (e.g., every 20th iteration when OPTIMIZE_IPRINT=20) for values <99 (and more generally follow the behavior for minimize option iprint).
The solution is to delete line 476 in create_area_weights, "disp": OPTIMIZE_IPRINT != 0,, shown below. I'll prepare a pull request to fix it.
Note that test for https://github.com/PSLmodels/tax-microdata-benchmarking/pull/223 fails, apparently due to a credentials issue. I will try to figure out how to fix that but can't attend to it until I am back from vacation. @martinholmer, if you're ok with the PR perhaps you can do what is needed to merge it, or else wait until I am back. There's certainly no rush on this.
disp expects None or int, overriding iprint when disp is int. However, we always give disp a True or False, which apparently always resolves to 1 or 0. Therefore when OPTIMIZE_IPRINT != 0, we are giving disp 1, and it prints every iteration.
Here is the documentation for iprint:
The solution is to delete line 476, thereby always keeping disp at the default of None. This keeps the current behavior of printing only one line at the last iteration when OPTIMIZE_IPRINT = 0, and will generally show every OPTIMIZE_IPRINT iterations for larger values < 99.
Currently, any value of OPTIMIZE_IPRINT other than 0 shows every iteration. Instead, it should show every OPTIMIZE_IPRINT iteration (e.g., every 20th iteration when OPTIMIZE_IPRINT=20) for values <99 (and more generally follow the behavior for
minimize
optioniprint
).The solution is to delete line 476 in create_area_weights,
"disp": OPTIMIZE_IPRINT != 0,
, shown below. I'll prepare a pull request to fix it.Note that test for https://github.com/PSLmodels/tax-microdata-benchmarking/pull/223 fails, apparently due to a credentials issue. I will try to figure out how to fix that but can't attend to it until I am back from vacation. @martinholmer, if you're ok with the PR perhaps you can do what is needed to merge it, or else wait until I am back. There's certainly no rush on this.
For details, see below.
Here's the
minimize
code:Here is the scipy minimize documentation for disp:
disp
expects None or int, overridingiprint
whendisp
is int. However, we always givedisp
a True or False, which apparently always resolves to 1 or 0. Therefore whenOPTIMIZE_IPRINT != 0
, we are givingdisp
1, and it prints every iteration.Here is the documentation for
iprint
:The solution is to delete line 476, thereby always keeping
disp
at the default of None. This keeps the current behavior of printing only one line at the last iteration when OPTIMIZE_IPRINT = 0, and will generally show every OPTIMIZE_IPRINT iterations for larger values < 99.