-
Notifications
You must be signed in to change notification settings - Fork 33
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
anshuverma2000
wants to merge
16
commits into
pyet-org:dev
Choose a base branch
from
anshuverma2000:my_fix
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
990ae50
Update master to pyet 1.3 (#69)
mvremec 46660b9
Update master to pyet 1.3.1 (#72)
raoulcollenteur 579e9db
Update python-publish.yml
raoulcollenteur af0b038
Update python-publish.yml (#73)
mvremec 4be8574
Update python-publish.yml
mvremec d016faa
Update python-publish.yml (#74)
raoulcollenteur a2debe2
Update python-publish.yml
raoulcollenteur d3b1cc4
Update python-publish.yml (#75)
mvremec f64e5c5
Update python-publish.yml
mvremec ff41178
Update python-publish.yml (#76)
raoulcollenteur 1d893f4
removed extra argument given
201a2c4
fix the nan output error
8a07777
fix all nan values in output error
3479d7a
temperary fix in oudin methods's function
e03fd14
rs/rso doubles the number of items in solar_rat and each of the value…
2b36d48
n/nn doubles the number of items in the series and each of the value …
anshuverma2000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
from numpy import sqrt, log | ||
from xarray import DataArray | ||
from pandas import Series | ||
from pandas import Series ,to_datetime | ||
from .meteo_utils import extraterrestrial_r, calc_press, calc_psy, calc_vpc, calc_lambda | ||
from .utils import get_index, check_rad, clip_zeros, pet_out, check_rh | ||
|
||
|
@@ -104,8 +104,11 @@ def jensen_haise(tmean, rs=None, cr=0.025, tx=-3, lat=None, method=0, clip_zero= | |
if lat is None: | ||
raise Exception("If you choose method == 1, provide lat!") | ||
index = get_index(tmean) | ||
ra = extraterrestrial_r(index, lat, tmean) | ||
pet = ra * (tmean + 5) / 68 / lambd | ||
ra = extraterrestrial_r(index, lat) | ||
|
||
temp = (tmean + 5) / 68 / lambd | ||
temp.index = to_datetime(temp.index) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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! |
||
pet = ra * temp | ||
else: | ||
raise Exception("Method can be either 0 or 1.") | ||
pet = clip_zeros(pet, clip_zero) | ||
|
@@ -148,7 +151,9 @@ def mcguinness_bordne(tmean, lat, k=0.0147, clip_zero=True): | |
ra = extraterrestrial_r(index, lat) | ||
if isinstance(tmean, DataArray) and isinstance(ra, Series): | ||
ra = ra.values[:, None, None] | ||
pet = k * ra * (tmean + 5) / lambd | ||
temp = (tmean + 5) / lambd | ||
temp.index = to_datetime(temp.index) | ||
pet = k * ra * temp | ||
pet = clip_zeros(pet, clip_zero) | ||
return pet_out(tmean, pet, "Mcguinness_Bordne") | ||
|
||
|
@@ -445,8 +450,11 @@ def oudin(tmean, lat, k1=100, k2=5, clip_zero=True): | |
""" | ||
lambd = calc_lambda(tmean) | ||
index = get_index(tmean) | ||
ra = extraterrestrial_r(index, lat) | ||
pet = ra * (tmean + k2) / lambd / k1 | ||
pet = pet.where((tmean + k2) >= 0, 0) | ||
ra = extraterrestrial_r(index, lat) | ||
temp = (tmean + k2) / lambd / k1 | ||
temp.index = to_datetime(temp.index) | ||
pet = ra * temp | ||
# pet = pet.where((tmean + k2) >= 0, 0) | ||
# the above line of code is not working properly and setting all the values in pet 0.0 | ||
pet = clip_zeros(pet, clip_zero) | ||
return pet_out(tmean, pet, "Oudin") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 :)