-
Notifications
You must be signed in to change notification settings - Fork 21
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
We need to go deeper - inspect_apsimx cannot access sowing date #166
Comments
Addendum: I managed to get around it by trying to use the "Manager" node instead :)
|
@LenLon Thanks for the report. The feature using node = "Other" is probably a bit unintuitive. I changed this behavior so that you can see the simulations components easily. This is a way of finding the 'root'. I'll create and post an example here. Ok. I'm labeling this as a bug. The method using node = "Manager" is your best option here. |
So "Other" is a catch-all node that shows the path to the parameter in the JSON simulation tree? Curious to see your example :) |
@LenLon This is still not perfect. I made a minor change that will make this error go away, but it will return nothing if it can't find it, which is not ideal. The problem with .apsimx files is that although they generally follow a predictable json pattern, sometimes they deviate from it, which makes it hard to write code that always works. In the case of Manager, the 'node = "Other"' method will not work unless I make substantial changes. Initially, for 'inspect_apsimx', node = 'Other' was almost useless. It was the counterpart of "node = 'Other'" in 'edit_apsimx', but you had to know the path already and the goal of 'inspect_apsimx' is not just to 'see' simulations, but to find the path and then edit them. The first change I made to 'node = 'Other'' in 'inspect' was to have the parameter be '0', '1', '2' or '3'. This simply prints the levels of a tree which is useful to find the different simulations in an APSIM file. This is the 'root' that might be needed for the 'edit_apsimx' function. I also have some functionality when node = "Other" and parm is a "character" or a "list". You started using the 'list' method with numbers, which is currently a relatively lazy way of finding some parameter paths. It is not fool-proof but it works some of the time. I will continue to improve them as I can. If you want to see more examples, there are some in the file 'test_inspect.R' starting at line 480. I greatly appreciate your interest in the package and the feedback. |
I currently am trying to edit the sowing date in my simulation using
edit_apsimx
. Unfortunately, it seems thatedit_apsimx
or ratherinspect_apsimx
are not able to dig "deep" enough in the .apsimx JSON file to get the attribute I want..What I want to edit:
Code I tried:
Should I try to add just one more level in the inspect_apsimx source code, is there another way, am I doing something stupid altogether? Thank you for the great package, I am learning a lot currently :)
The text was updated successfully, but these errors were encountered: