Skip to content
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

Sunset computation broken beyond polar circle - raise exception. #13

Closed
vvasuki opened this issue Dec 15, 2017 · 3 comments
Closed

Sunset computation broken beyond polar circle - raise exception. #13

vvasuki opened this issue Dec 15, 2017 · 3 comments
Assignees

Comments

@vvasuki
Copy link
Contributor

vvasuki commented Dec 15, 2017

The code was working yesterday - #10 . After I did some non-functional changes (renaming functions, reformatting code and the like), I faced a brentq error, which I fixed. But now I get the below:

No precomputed data available. Computing panchangam... DEBUG: 2017-12-15 15:03:57,622 {spatio_temporal.py:161}: 0.0 
DEBUG: 2017-12-15 15:03:57,622 {spatio_temporal.py:162}: 10 
DEBUG: 2017-12-15 15:03:57,623 {spatio_temporal.py:163}: -0.634040778754029 
DEBUG: 2017-12-15 15:03:57,623 {spatio_temporal.py:164}: 0.5376589639327491 
ERROR: 2017-12-15 15:03:57,769 {spatio_temporal.py:246}: 11 
[2017-12-15 15:03:57,770] ERROR in app: Exception on /jyotisha/v1/calendars/coordinates/80:16:12/13:05:24/years/2017 [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.6/dist-packages/flask_restplus/api.py", line 313, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/flask/views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/flask_restplus/resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/home/vvasuki/jyotisha/jyotisha/rest_api/api_v1.py", line 40, in get
    panchangam = scripts.get_panchangam(city=city, year=int(year), script=args['encoding'])
  File "/home/vvasuki/jyotisha/jyotisha/panchangam/scripts/__init__.py", line 32, in get_panchangam
    panchangam.compute_angams(computeLagnams=computeLagnams)
  File "/home/vvasuki/jyotisha/jyotisha/panchangam/spatio_temporal.py", line 247, in compute_angams
    raise (ValueError('Dec 31 does not appear to be Dhanurmasa!'))
ValueError: Dec 31 does not appear to be Dhanurmasa!

I fancy that karthik may be able to deduce what went wrong faster. In the meantime, I'll try to shift from doctests to pytest so as to enable continuous automated testing.

@vvasuki
Copy link
Contributor Author

vvasuki commented Dec 15, 2017

From the logs, it seems that the following call is returning 0:

  jd_sunset = swe.rise_trans(jd_start=jd_start, body=swe.SUN, lon=city.longitude,
                             lat=city.latitude, rsmi=swe.CALC_SET | swe.BIT_DISC_CENTER)[1][0]

@vvasuki
Copy link
Contributor Author

vvasuki commented Dec 16, 2017

As astrorigin/pyswisseph#13 shows, this is false alarm. Leaving thread open so as to raise an exception for illegal input.

@vvasuki vvasuki changed the title mAsa computation broken Sunset computation broken beyond polar circle - raise exception. Dec 16, 2017
@karthikraman
Copy link
Contributor

Fixed vide 171b707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants