jyotisham / jyotisha

Python tools for the astronomical / astrological vedAnga of Hindus
MIT License
88 stars 53 forks source link

test_annual.test_panchanga_chennai() failing #29

Closed vvasuki closed 5 years ago

vvasuki commented 5 years ago

I noticed that panchanga computation computes significantly different numbers. @karthikraman - could you validate/ fix the data and logic of test_annual.test_panchanga_chennai() so that I may confidently make code changes based on passing tests?

karthikraman commented 5 years ago

First, we need a better way to compare panchangas. Since we're comparing float values, I think we should check if all numbers in both files are within some epsilon of one another, rather than exact. I'll upload some proper panchanga files shortly.

karthikraman commented 5 years ago

Also, the files DON'T contain festival details, so those may have to be checked separately.

karthikraman commented 5 years ago

BTW, novice question(?): how do I run test_annual.py. I am getting:

Traceback (most recent call last):
  File "test_annual.py", line 21, in <module>
    with open(CONFIG_PATH) as config_file:
FileNotFoundError: [Errno 2] No such file or directory: 'config_local.json'
vvasuki commented 5 years ago

BTW, novice question(?): how do I run test_annual.py. I am getting:

Removed unnecessary reference to the config files.

First, we need a better way to compare panchangas. Since we're comparing float values, I think we should check if all numbers in both files are within some epsilon of one another, rather than exact.

I suspect that this doesn't matter because the file is generated as well as compared on very similar python setups.

Also, the files DON'T contain festival details, so those may have to be checked separately.

True - would be good to have a separate test which covers that so that I can safely mess with festival assignment logic.

karthikraman commented 5 years ago

Do you think we can create a test to test the TeX content? That's usually my "manual" test, by diffing the TeX files to see if anything has broken!

vvasuki commented 5 years ago

Sure - please do - though let them be separate tests from json-comparison based tests.

vvasuki commented 5 years ago

Failing again. So are the daily_tex tests.

भद्र @karthikraman - सङ्गणकादेशपरिवर्तने सुरक्षायै सर्वदैव परीक्षास् सफला स्युः। अधुनाहं https://github.com/sanskrit-coders/jyotisha/issues/17 इत्यस्मिन् विषये कार्यं कर्तुम् उपक्रान्तः पूर्वं परीक्षाश् चालयितुम् अयते। पूर्वमेव परीक्षा न सफला इति सविश्वासं सङ्गणकादेशपरिवर्तने माम् असमर्थङ्करोति। यावच्छीघ्रं परीक्ष्य समीकुर्याः।

karthikraman commented 5 years ago

क्षम्यताम्। अहं TeX, json files update न कृतवान्। अद्य रात्रौ समीकर्तुं प्रयत्नं करिष्यामि।

karthikraman commented 5 years ago

The test data files just needed to be updated. The current commit is "good".

Fixed. (One additional change was default write_daily_tex ayanamsha is TRUE_CITRA). Also, I couldn't figure how to write fewer decimals to the JSON... should've figured it out with you instead of avoiding generating the updates files, due to which the tests broke.