jyotisham / jyotisha

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

tithidvayam in shraadha_tithi showing up as `TITHI: 00` (like shunya) #60

Closed karthikraman closed 3 years ago

karthikraman commented 3 years ago

Fixed by checking for re-computation via 22b6feafea82b32a857c3ee450ce5d9cdceb9c5f. Where is the re-computation happening?

vvasuki commented 3 years ago

Fixed the recomputation problem, but reopening because the shrAddha tithi assignment function (taken in isolation) is malfunctioning (not being idempotent). The former fix in https://github.com/sanskrit-coders/jyotisha/commit/22b6feafea82b32a857c3ee450ce5d9cdceb9c5f , though effective, is ugly (perhaps because it was intended to be temporary thing). Please think of a elegant way to make the function idempotent.

(Along the way, if time permits, please try to break up the function into smaller methods (no more than say 80 lines long).

vvasuki commented 3 years ago

Ugh - just realized you recommitted the ugly fix. You say in the commit (but not in the code!) that it is "temporary", but a paraphrase of Milton Freedman who said "Nothing is so permanent as a temporary government program" would apply to such from past experience!

I was hoping that you'd go for something simple and more elegant than inserting an extra field only in the first day's panchaanga (if needed even https://github.com/sanskrit-coders/jyotisha/commit/2a1ea975e82a40bba5ba8e7351a595a298847011 , which solves this issue) :-D Well, anyway, solved until that titanic function is rewritten.