Code Monkey home page Code Monkey logo

gracedb's People

Contributors

dependabot[bot] avatar roald87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gracedb's Issues

Speed up /status command

/status command can easily be sped up by only retrieving the data from the source once, instead of once times for each detector.

Detector status doesn't work when there is an unknow state

Command /status gives no reply when a detector status is in an state without a time.

  File "/root/Projects/GraceDB/gracebot/detector.py", line 44, in __post_init__
    self.duration = self._convert_to_time(duration)
  File "/root/Projects/GraceDB/gracebot/detector.py", line 67, in _convert_to_time
    hours, minutes = time_string.split(":")

No update message was sent to user when event S190701AH was updated

After event S190701AH was updated user got no message that the event was updated. Probably the origin why #1 stopped working.

Error message after update was requested:

2019-07-05 03:40:46 	 root         INFO     Refreshing event database.

Updating events: [                              ] 0%2019-07-05 03:40:54 	 asyncio      ERROR    Task exception was never retrieved
future: <Task finished coro=<Events._periodic_event_updater() done, defined at /root/Projects/GraceDB/gracebot/gwevents.py:107> exception=<HTTPError 404: 'Not Found'>>
Traceback (most recent call last):
  File "/root/Projects/GraceDB/gracebot/gwevents.py", line 118, in _periodic_event_updater
    self.update_all_events()
  File "/root/Projects/GraceDB/gracebot/gwevents.py", line 46, in update_all_events
    self.update_single_event(_event["superevent_id"])
  File "/root/Projects/GraceDB/gracebot/gwevents.py", line 72, in update_single_event
    voevent.from_event_id(event_id)
  File "/root/Projects/GraceDB/gracebot/voevent.py", line 107, in from_event_id
    self._add_distance(self._data["skymap_fits"])
  File "/root/Projects/GraceDB/gracebot/voevent.py", line 59, in _add_distance
    with fits.open(url) as fit_data:
  File "/root/venvs/gracedb/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 151, in fitsopen
    lazy_load_hdus, **kwargs)
  File "/root/venvs/gracedb/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 390, in fromfile
    lazy_load_hdus=lazy_load_hdus, **kwargs)
  File "/root/venvs/gracedb/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 1039, in _readfrom
    fileobj = _File(fileobj, mode=mode, memmap=memmap, cache=cache)
  File "/root/venvs/gracedb/lib/python3.7/site-packages/astropy/utils/decorators.py", line 521, in wrapper
    return function(*args, **kwargs)
  File "/root/venvs/gracedb/lib/python3.7/site-packages/astropy/io/fits/file.py", line 147, in __init__
    self.name = download_file(fileobj, cache=cache)
  File "/root/venvs/gracedb/lib/python3.7/site-packages/astropy/utils/data.py", line 1091, in download_file
    raise e
  File "/root/venvs/gracedb/lib/python3.7/site-packages/astropy/utils/data.py", line 1024, in download_file
    with urllib.request.urlopen(remote_url, timeout=timeout) as remote:
  File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

Make /event user independent

If two users try to select an event simultaneously it sometimes skip pages, because the self.start_at parameter in GraceBot class is not unique per user.

Most likely event type stopped working for event S190701AH

The following error showed when /stats didn't work and /latest didn't show the event type. I think it was after event S190701AH was updated.

2019-07-06 21:03:47 	 aiohttp.server ERROR    Error handling request
Traceback (most recent call last):
  File "/root/venvs/gracedb/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/root/venvs/gracedb/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/root/venvs/gracedb/lib/python3.7/site-packages/aiohttp/web_urldispatcher.py", line 890, in _iter
    resp = await method()
  File "/root/venvs/gracedb/lib/python3.7/site-packages/aiogram/dispatcher/webhook.py", line 137, in post
    results = await self.process_update(update)
  File "/root/venvs/gracedb/lib/python3.7/site-packages/aiogram/dispatcher/webhook.py", line 188, in process_update
    return fut.result()
  File "/root/venvs/gracedb/lib/python3.7/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "/root/venvs/gracedb/lib/python3.7/site-packages/aiogram/dispatcher/dispatcher.py", line 162, in process_update
    return await self.message_handlers.notify(update.message)
  File "/root/venvs/gracedb/lib/python3.7/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "gracebot/main.py", line 36, in send_o3_stats
    await bot.send_o3_stats(message)
  File "/root/Projects/GraceDB/gracebot/gracebot.py", line 167, in send_o3_stats
    [info["most_likely"] for info in self.events.events.values()]
  File "/root/Projects/GraceDB/gracebot/gracebot.py", line 167, in <listcomp>
    [info["most_likely"] for info in self.events.events.values()]
KeyError: 'most_likely'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.