jyotisham / jyotisha

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

Error when running gen_daily_txt.sh #51

Closed akrishna3 closed 4 years ago

akrishna3 commented 4 years ago

The gen_daily_txt.sh (and other scripts) have an invalid reference to the modules from the jyotish project. I made the following correction to the script for testing:

< python3 -m jyotisha.panchangam.scripts.write_daily_panchangam_txt $city_name $lat $lon $tz $y $script $fmt $lagna --- > python3 -m jyotisha.panchaanga.writer.write_daily_panchaanga_txt $city_name $lat $lon $tz $y $script $fmt $lagna

This fixes the script execution. But now, there is another error from one of the modules. I will post an update if I can resolve it.

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/dist-packages/jyotisha/panchaanga/writer/write_daily_panchaanga_txt.py", line 465, in <module>
    main()
  File "/usr/local/lib/python3.7/dist-packages/jyotisha/panchaanga/writer/write_daily_panchaanga_txt.py", line 452, in main
    panchaanga = annual.get_panchaanga_for_civil_year(city=city, year=year)
  File "/usr/local/lib/python3.7/dist-packages/jyotisha/panchaanga/spatio_temporal/annual.py", line 72, in get_panchaanga_for_civil_year
    return load_panchaanga(fname=fname, fallback_fn=fn) 
  File "/usr/local/lib/python3.7/dist-packages/jyotisha/panchaanga/spatio_temporal/annual.py", line 30, in load_panchaanga
    panchaanga.update_festival_details()
  File "/usr/local/lib/python3.7/dist-packages/jyotisha/panchaanga/spatio_temporal/periodical.py", line 250, in update_festival_details
    applier.MiscFestivalAssigner(panchaanga=self).assign_all(debug=debug)
  File "/usr/local/lib/python3.7/dist-packages/jyotisha/panchaanga/temporal/festival/applier/__init__.py", line 338, in __init__
    super(MiscFestivalAssigner, self).__init__(panchaanga=panchaanga)
  File "/usr/local/lib/python3.7/dist-packages/jyotisha/panchaanga/temporal/festival/applier/__init__.py", line 21, in __init__
    self.rules_collection = rules.RulesCollection.get_cached(repos=tuple(panchaanga.computation_system.options.fest_repos))
  File "/usr/local/lib/python3.7/dist-packages/methodtools.py", line 72, in __call__
    return self.__call__(*args, **kwargs)
TypeError: unhashable type: 'RulesRepo'
error!
vvasuki commented 4 years ago

Please update sanskrit_data package as well as this one. Also, please submit pull request fixing references in the shell scripts.

vvasuki commented 4 years ago

PS: You can look at test results for each commit here - https://github.com/sanskrit-coders/jyotisha/actions and see if the clean-installed code has errors you're getting.

akrishna3 commented 4 years ago

Thanks @vvasuki for the response. That fixed the error I was getting. I will review all my changes and submit the modifications to the project.