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

Transplanting not working and not present in executable; how to turn water off in model #23

Open
osherboudara-work opened this issue Dec 13, 2023 · 5 comments

Comments

@osherboudara-work
Copy link

osherboudara-work commented Dec 13, 2023

Hello @daquinterop!

Hope you are doing well. My team has been having some issues with our model simulations.

  1. We are trying to set transplanting date but for some reason, every parameter attempted does not change the model output (even though it should). The way I am setting this is by modifying the planting details after initializing the management object (specifically the PAGE variable). Is there something else we need to do to set transplanting? We have been in touch with Garrit Hoogenboom and he mentioned that we should be able to define the actual plants which are transplanted along with the age and size of transplant and that information should be outputted in the executable too. How would we be able to configure all this?

  2. My team and I are trying to mimic a "potential production" simulation (i.e. turning off all water, nitrogen effects etc). For some reason, when I try to turn off water from the simulation controls and then attempt to execute the model, the model fails to execute. Is there a way to turn off water in the model?

Thank you for your great work on this Python library!

@osherboudara-work
Copy link
Author

osherboudara-work commented Dec 13, 2023

Another note, the error from my second issue with water is coming from the below of code. It seems the SoilWat.OUT is not being removed from the OUTPUT_LIST variable. It is coming from this file at the link: file

OUTPUT_FILES = [i for i in os.listdir(self._RUN_PATH) if i[-3:] == 'OUT']
self.OUTPUT_LIST = [
var for var in OUTPUTS
if management.simulation_controls.get(OUTPUT_MAP.get(var)) in ("Y", None)
]

if management.simulation_controls["WATER"] == "N":
self.OUTPUT_LIST = list(filter(lambda x: x != "SoilWat", self.OUTPUT_LIST))

for file in self.OUTPUT_LIST:
assert f'{file}.OUT' in OUTPUT_FILES,
f'{file}.OUT does not exist in {self._RUN_PATH}'

@daquinterop
Copy link
Owner

Hi @osherboudara-work, I'm sorry I haven't had time to reply.

You can find an example of setting the transplant options here in one of the tests.

Regarding the second error, I think that I already fixed that bug. can you please let me know what version of DSSATTools you're using? I'll check on my code and I'll try the reproduce the error, thanks for reporting it.

@osherboudara-work
Copy link
Author

osherboudara-work commented Dec 15, 2023

Hello @daquinterop! No worries at all!

Thank you for your response. I have looked in the tests file you have attached but I have not be able to locate the code where transplanting is set. Do you mind pointing to the line of code it is on?

For the second issue, I reinstalled the library at the beginning of this week so I am using the most updated version. For some reason, when I turn off water in simulation controls, the error mentioned above still occurs.

Thank you again for all your work on this great library!

@daquinterop
Copy link
Owner

Hi again. It's on line 525.
Ok, thanks for you response. I'll try to reproduce the error and fix the bug. Thanks again for reporting this.

@osherboudara-work
Copy link
Author

@daquinterop of course. Let me know if you need any other information and when the issue is fixed.

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

No branches or pull requests

2 participants