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

soil profile (Aida's work) and evaluation metrics #199

Closed
wants to merge 1 commit into from

Conversation

Bijan55699
Copy link
Collaborator

Addition of two new soil profiles (Aida's work) and activation of evaluation period command.

@Bijan55699 Bijan55699 self-assigned this Sep 16, 2022
@Bijan55699 Bijan55699 requested a review from huard September 16, 2022 02:49
@Bijan55699
Copy link
Collaborator Author

soil profile (Aida's work) and evaluation metrics

@@ -250,7 +250,7 @@ class RVI(RV):
# come after `:SoilModel`
_post_tmpl = """
:EvaluationMetrics {evaluation_metrics}
{evaluation_periods}
:EvaluationPeriod {evaluation_periods}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there is a problem with the original formulation, this should not be changed.

This is the definition of the EvaluationPeriod command:

@dataclass
class EvaluationPeriod(RavenCommand):
   """:EvaluationPeriod [period_name] [start yyyy-mm-dd] [end yyyy-mm-dd]"""

   name: str
   start: dt.date
   end: dt.date

   template = ":EvaluationPeriod {name} {start} {end}"

   def to_rv(self):
       return self.template.format(**asdict(self))

In practice, use something like (untested):

model.config.rvt.evaluation_periods = [EvaluationPeriod('wet', dt,date(1990, 1, 1), dt.date(2000, 1, 1))]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huard @Zeitsperre : Just to be more specific: the original formulation doesn't write the "Evaluation Period" command in the .rvi file, and therefore, the specified evaluation period is not considered in the simulation. The ":EvaluationPeriod {evaluation_periods}" seems to activate this command.
This PR is about the evaluation period and not metrics (sorry for my mistake!)

Thanks

Mohammad

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "original formulation" ?

template = ":EvaluationPeriod {name} {start} {end}"

If there's a but with the EvaluationPeriod configuration, let's fix it in another PR.

@huard
Copy link
Collaborator

huard commented Sep 16, 2022

@Zeitsperre Seems to be a problem with the netcdf build. No objection pulling 3.7 from the suite if that simplifies things.

@Zeitsperre
Copy link
Member

I believe it's this issue here: Unidata/netcdf4-python#1179. The wheel is bad on PyPI. I can add the fix for it in here at some point.

@Zeitsperre
Copy link
Member

@huard Python3.7 is rapidly approaching end of life, so let's do that and see if the issue stems from there. I'm going to drop it in another PR.

@huard huard closed this Oct 26, 2022
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