-
Notifications
You must be signed in to change notification settings - Fork 24
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
Key Error when running AC-MADS-TEM.jl
with target data containing compartments (E.g. VEGC, VEGN)
#738
Comments
@Benjamin-Maglio just noticed that there is a comment about compartments right before line 312 in |
@tobeycarman when I tried that I get this similar but different error: ERROR: LoadError: PyError ($(Expr(:escape, :(ccall(#= /home/develop/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'> |
@valeriabriones @Benjamin-Maglio, wow, on account of your issues, I just found a separate, but kinda related bug!! In Notice that the test actually includes a target with compartment values (VegCarbon), but the test was passing. Basically because the return statement is indented one level too far. Here is one question that comes up: what do you want the returned vector to look like? Still a flat list enumerating the targets by PFT and compartment, i.e. like this:
or organized some other way? |
@tobeycarman I think a flat list still works well for the current workflow we have set up! So the indentation allowed it to pass although it wasn't working properly? |
@valeriabriones ok, so that order is good? Or would you rather have it in a similar order to how they are listed in the targets?
Option (2) looks like this (more like the existing
In either case, it seems like the totally flattened list might be kind of error prone to work with as the number of targets increases??? It would be up to the user of the I think that so far this has not been a problem because y'all haven't been using this |
@tcarman you're right I think we're only referencing this function within the MADS calibration only and not in other calibration functions, so maybe it wouldn't disrupt anything to modify the output format. Maybe Format Option 1 would make sense, but would be good to get your thoughts @Benjamin-Maglio @jsclein-uaf ? |
Yeah, maybe a better option is to return a richer data structure, like a pandas DataFrame, something like this:
|
@valeriabriones I agree with option 1, I think that also matches sensitivity too? @tobeycarman, how do you foresee this structure being used? Currently, I'm only really concerned with having MADs run, but is there a benefit to using this for something else? |
@Benjamin-Maglio good point - I don't have a direct use, maybe just thinking if I were to consume the data it would be less error prone to have it be labeled. In any case I ended up with both implementations (flat and labeled) as it ended up being easier way to try testing the expected order of the list. I will admit I am not sure I understand the implications of the previous bug with the return value of the |
@tobeycarman Yeah I mean the labeled data is much nicer, and I could see there being some application at some point... |
@Benjamin-Maglio I did not try full MADS run. That doctest script uses the MadsTEMDriver.run() function, but that doesn't really invoke anything with MADS. If you are setup to try it that would be great. I expect that PR to fix the original bug but maybe uncover more :-), |
@tcarman @Benjamin-Maglio I implemented the changes and am still getting some syntax errors starting at the line in AC-MADS-TEM.jl ERROR: LoadError: syntax: character literal contains multiple characters |
Oh! My bad - Julia likes double quotes for strings, single quotes for
single chars. So if you change to double quotes, it should help
…On Wed, Sep 11, 2024 at 8:44 AM valeriabriones ***@***.***> wrote:
@tcarman <https://github.com/tcarman> @Benjamin-Maglio
<https://github.com/Benjamin-Maglio> I implemented the changes and am
still getting some syntax errors starting at the line in AC-MADS-TEM.jl targets
= dvmdostem.observed_vec(format= 'format')
ERROR: LoadError: syntax: character literal contains multiple characters
Stacktrace:
[1] top-level scope
@ /work/mads_calibration/AC-MADS-TEM.jl:111
in expression starting at /work/mads_calibration/AC-MADS-TEM.jl:111
—
Reply to this email directly, view it on GitHub
<#738 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGMYT6FI72VUUSHXFEUUZLZWBXOLAVCNFSM6AAAAABNYWW4VGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBUGE2TKNRQGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@tobeycarman thank you that did the trick! Also the return targets should be aligned with the last if statement, or else it returns a call error. Not sure if I can edit the commit once its 'pending'? |
@valeriabriones hey so were you able to test this by checking out the branch |
@tobeycarman No I did a hack and manually copied the revised code into my current set up on master |
@tobeycarman tried testing the revised MADS on a calibration run with soil and vegetation but ended up getting this new error: |
@tcarman @Benjamin-Maglio I was able to complete all MADS calibration runs (soil, veg, veg + soil), however it seems with the updated code there are still some issues. Only the MADS with just vegetation as the target produced the iteration files. Running separate valibrations for soil and veg+soil did not produce the final files. The error produced when running separate MADS for soil, soil+veg were both similar: |
OK. Thats good - it seems to be getting past the "expensive" part (the For the record, we met offline and updated @valeriabriones workstation and containers to v0.8.0 and then pulled #741 into a temporary integration branch for testing. |
I am still hitting a similar error to earlier:
I'll try and follow the approach above (updated workstation, containers, and create and temporary integration branch) |
Ok, so I followed a similar approach above updating containers and creating a temporary integration branch and this error has gone. I am now getting the same error as @valeriabriones. I'm going to try and fix this issue today by working through the plotting in Python / Julia terminal |
@tobeycarman @Benjamin-Maglio Not sure if you have come across any issues since the updates with the AC-MADS-TEM.jl, but after running calibration a few times now it seems there is something going on where post-MADS optimal targets are returning as NaN or zero for some/ all of the targets: |
Weird, I haven't encountered this. So are the values NaNs or zeros in the |
Ok, I can dig a big further. The parameter values write out correctly, but the OF and lamda values in the .finalresults are NaN as well |
I'll try and take a look at this today. Is this happening for a specific configuration (e.g. compartment, pft specific variables)? Or particular parameters? |
It seems to be with both soil and non-soil targets similarly with parameters Its happened with kdcs and soil as well as cmax and INGPP. |
Ok, I will try to replicate this issue! |
The following error is occurring when loading target data in
AC-MADS-TEM.jl
for variables with compartments such as vegetation carbon or nitrogen:The text was updated successfully, but these errors were encountered: