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

Showing example pounders/formquad failure #149

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

jmlarson1
Copy link
Collaborator

@jmlarson1 jmlarson1 commented Jun 12, 2024

I was doing some test and encountered an example problem that failed on develop. I see that it also fails on main.

When nf = 489 we enter a model-improving step and get an error:

Traceback (most recent call last):
  File "/home/jlarson/research/poptus/IBCDFO/pounders/py/tests/test_showing_failure.py", line 45, in <module>
    [X, F, flag, xkin] = pdrs.pounders(Ffun, X0, n, npmax, nfmax, gtol, delta, nfs, 1, F0, xind, Low, Upp, printf, spsolver, hfun, combinemodels)
  File "/home/jlarson/research/poptus/IBCDFO/ibcdfo_pypkg/src/ibcdfo/pounders/pounders.py", line 289, in pounders
    Hres = Hres + Hresdel
ValueError: operands could not be broadcast together with shapes (4,4,1) (0,0) 

I don't know why we haven't encountered this before. But you can see that it happens in the GitHub Actions:
https://github.com/POptUS/IBCDFO/actions/runs/9488351840/job/26147086251?pr=149#step:5:2979

@coveralls
Copy link

coveralls commented Jun 12, 2024

Pull Request Test Coverage Report for Build 9488161893

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.855%

Totals Coverage Status
Change from base Build 7744656838: 0.0%
Covered Lines: 1386
Relevant Lines: 1431

💛 - Coveralls

@jmlarson1 jmlarson1 changed the title Showing example Showing example pounders/formquad failure Jun 12, 2024
@coveralls
Copy link

coveralls commented Jun 12, 2024

Pull Request Test Coverage Report for Build 9488250299

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.855%

Totals Coverage Status
Change from base Build 7744656838: 0.0%
Covered Lines: 1386
Relevant Lines: 1431

💛 - Coveralls

@jmlarson1 jmlarson1 requested review from wildsm and mmenickelly June 12, 2024 19:12
@coveralls
Copy link

coveralls commented Jun 12, 2024

Pull Request Test Coverage Report for Build 9488342748

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+3.1%) to 100.0%

Totals Coverage Status
Change from base Build 7744656838: 3.1%
Covered Lines: 0
Relevant Lines: 0

💛 - Coveralls

@jmlarson1
Copy link
Collaborator Author

@wildsm If I take this python example directly to matlab, the crash/error is not present. The iterates (or function evals) differ enough.

Instead, if I save all of the inputs to the last call to formquad.py in pounders.py before, and then load this in matlab and re-create the calls to formquad.m, I'm able to recreate the issue (in R2023b at least).

Running in matlab produces the following:

>> cd ~/research/poptus/IBCDFO/pounders/m/
>> test_formquad
Error using  + 
Arrays have incompatible sizes for this operation.

Error in test_formquad (line 14)
    Hres = Hres + Hresdel;

So, like in python, the matlab can produce an empty Hresdel.

@wildsm
Copy link
Collaborator

wildsm commented Aug 5, 2024

@wildsm If I take this python example directly to matlab, the crash/error is not present. The iterates (or function evals) differ enough.

Instead, if I save all of the inputs to the last call to formquad.py in pounders.py before, and then load this in matlab and re-create the calls to formquad.m, I'm able to recreate the issue (in R2023b at least).

Running in matlab produces the following:

>> cd ~/research/poptus/IBCDFO/pounders/m/
>> test_formquad
Error using  + 
Arrays have incompatible sizes for this operation.

Error in test_formquad (line 14)
    Hres = Hres + Hresdel;

So, like in python, the matlab can produce an empty Hresdel.

I can recreate the above in R2023a, thank you!

I will look into a solution.

@jmlarson1
Copy link
Collaborator Author

@wildsm I know that the first test_formquad failure didn't provide enough context to debug.

I have now saved the state of every variable at the top of the last loop of pounders.py. You can now load that into matlab and see the model/Res/D values in matlab, which I have done in the example larger_test_formquad.m. If you run in matlab, you should see:


>> cd ~/research/poptus/IBCDFO/pounders/m/
>> larger_test_formquad
Error using  + 
Arrays have incompatible sizes for this operation.

Error in larger_test_formquad (line 230)
            Hres = Hres + Hresdel;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants