Skip to content

Commit

Permalink
When date of the year was given to get_day() it calculated the day (J)
Browse files Browse the repository at this point in the history
as '0'
  • Loading branch information
sherzodr committed Oct 1, 2020
1 parent a121789 commit 2a9b5d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

setup(
name="penmon",
version="0.1.3",
version="0.1.5",
description="Implementation of Penman-Monteith equation to calculate ET for a reference crop",
# long_description_content_type="text/markdown",
# long_description=long_description,
author="Sherzod RUZMETOV",
author_email="sherzodr@gmail.com",
license="MIT",
url="https://github.com/sherzodr/penmon",
download_url="https://github.com/sherzodr/penmon/archive/0.1.3.tar.gz",
download_url="https://github.com/sherzodr/penmon/archive/0.1.5.tar.gz",
py_modules=["penmon.eto"],
package_dir={'': 'src'},
packages=["penmon"],
Expand Down
2 changes: 1 addition & 1 deletion src/penmon/eto.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_day(self, day_number):

dt0 = dt.datetime(dt1.year, 1, 1)
dates_delta = dt1 - dt0
day_number = dates_delta.days
day_number = dates_delta.days+1

if not type(day_number) is int:
raise TypeError("'day_number' must be an integer")
Expand Down
5 changes: 4 additions & 1 deletion tests/test_date_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ def test_date_parse(self):
day = station.get_day(228)
self.assertEqual(day.day_number, 228)

day=station.get_day("2020-01-01")
self.assertEqual(day.day_number, 1)

day=station.get_day("2020-08-16")
self.assertEqual(day.day_number, 228)
self.assertEqual(day.day_number, 229)

if __name__ == "__main__":
#import sys;sys.argv = ['', 'Test.testName']
Expand Down

0 comments on commit 2a9b5d9

Please sign in to comment.