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

removed extra argument given #78

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from

Conversation

anshuverma2000
Copy link

Short Description

Add a short description describing the pull request (PR) here.

Checklist before PR can be merged:

  • closes issue #xxxx
  • is documented
  • Format code with Black formatting
  • type hints for functions and methods
  • tests added / passed
  • Example Notebook (for new features)
  • Remove output for all notebooks with changes

mvremec and others added 12 commits March 14, 2024 14:07
**What's new:** 
- Fixed issue with Latitude above 65 °N, eanling PET estimation for high-latitude regions pyet-org#70 
- Added examples using CMPI data, and an example with determining the crop coefficient. 
- Introduced xarray tests to ensure robust data handling and manipulation, improving reliability.
- Improved documentation.
pet = ra * (tmean + 5) / 68 / lambd
ra = extraterrestrial_r(index, lat)

temp = (tmean + 5) / 68 / lambd

Choose a reason for hiding this comment

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

Can i suggest to put the parenthesis here to make clear which division is made first.

I'm sure the code is correct but it is not clear which is the first division :)

@mvremec
Copy link
Contributor

mvremec commented May 6, 2024

Thank you both for your contributions and for identifying the error! I just returned from holiday and will review the materials as soon as possible.

I am proposing the following additions to the Checklist before this PR can be merged:

anshuverma2000 and others added 2 commits May 8, 2024 06:02
Copy link
Contributor

@mvremec mvremec left a comment

Choose a reason for hiding this comment

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

Thank you for noticing this!

Copy link
Contributor

@mvremec mvremec left a comment

Choose a reason for hiding this comment

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

I mistakenly approved this pull. After a more thorough review, here are some detailed thoughts on the changes:

  1. Extra Argument: Thank you for catching that!
  2. Datetime Check: There’s no need to add to_datetime since tmean should already be a DatetimeIndex. To ensure this, we should add a check for tmean.index.
  3. Oudin Method: The implementation using "pet = pet.where((tmean + k2) >= 0, 0)" is correct as per our model requirements. Let’s keep this as is.

@mvremec mvremec changed the base branch from master to dev June 9, 2024 10:07
ra = extraterrestrial_r(index, lat)

temp = (tmean + 5) / 68 / lambd
temp.index = to_datetime(temp.index)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use "to_datetime"? The temp should already be DatetimeIndex?

Thank you for your contributions!

@mvremec
Copy link
Contributor

mvremec commented Jun 9, 2024

Hi @anshuverma2000,

Thank you for catching the extra argument! I'd appreciate your insights on a couple of other points to help us address the issues effectively:

  • Input Data Type: Could you confirm whether you are using xarray.DataArray or pandas.Series as input? This will help us understand the context better.
  • Error Details: Can you provide more specifics about when and under what circumstances the error with NaNs occurred?
    Thank you for your collaboration!

Best,
Matevz

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.

4 participants