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

DM-27985: Improvements to query system, especially temporal aspects #450

Merged
merged 20 commits into from
Dec 17, 2020

Commits on Dec 17, 2020

  1. Configuration menu
    Copy the full SHA
    ed4f0d3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a060fa View commit details
    Browse the repository at this point in the history
  3. Rework interfaces for database representations of topological regions.

    This adds a new SpatialRegionDatabaseRepresentation class to
    encapsulate how we store regions in the database, and shuffles some
    code between TimespanDatabaseRepresentation and its (and the new
    class's) base class, TopologicalEndpointDatabaseRepresentation.
    
    Because we still only have one representation for spatial regions in
    the database (opaque byte strings with no database-side operators),
    this doesn't change functionality, but it cleans up centralizes what
    was previously a lot of scattered hard-coding of how we handle regions.
    
    It may also make it a bit easier to support database-native regions
    with real operators someday in the future, but given that don't know
    if we'll ever want that, that's at most a small side bonus.
    TallJimbo committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    c2274c4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    55bc8c0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    863d860 View commit details
    Browse the repository at this point in the history
  6. Improve stringification of DataCoordinate.

    In addition to adding __repr__ and one __str__ to the classes returned
    by .full and .records, this makes DataCoordate.__repr__ report only
    required dimensions, because that's all that's in keys().  That's good
    because the inherited values() implementation returns a ValuesView with
    a __repr__ that prints the __repr__ of the whole mapping, so before
    this change, the keys *appearing* there would differ both from what was
    actually in the ValuesView and what was in the keys (and the same was
    true of items()/ItemsView, I think).
    TallJimbo committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    fb1eb5f View commit details
    Browse the repository at this point in the history
  7. Rewrite Timespan with more careful edge-case handling and new methods.

    This moves conversion to integer nanoseconds from astropy.time.Time to
    Timespan, instead of at the SQLAlchemy layer, which means we can
    finally make the edge-case handling (which has been improved - in that
    it's now consistent - in other ways) actually the same in Python and
    the DB.
    
    This also adds methods to construct TimespanDatabaseRepresentation
    instances from Timespan literals. That means we don't need to provide
    methods that relate TimespanDatabaseRepresentation to Timespan
    anymore.  Code that starts with a mix of those types is now
    responsible for doing the conversion.
    
    On the other hand, because Timespan and TimespanDatabaseRepresentation
    can't exactly represent instants in time, we do need "overloads" for
    relatinship methods that take astropy.time.Time and
    sqlalchemy.sql.ColumnElement objects that represent times.
    TallJimbo committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    0b29c0f View commit details
    Browse the repository at this point in the history
  8. New module for converting WHERE expressions to SQL.

    This one has support for timespan columns and bindparams, but is not
    used yet.
    TallJimbo committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    3ef4a5c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ab2dad7 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    86676a7 View commit details
    Browse the repository at this point in the history
  11. Remove now-unused ClauseVisitor class.

    This was the old way of converting expression trees to SQL.
    TallJimbo committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    c6e1999 View commit details
    Browse the repository at this point in the history
  12. Reorganize expression-related modules.

    This commit is _just_ moving code around and changing import
    statements.
    TallJimbo committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    6e03ec7 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    f5db051 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    7db96d7 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    35b7ad8 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    fa76e2e View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    4163701 View commit details
    Browse the repository at this point in the history
  18. Move time-nsec conversion into a singleton class.

    This defers all operations until first use (instead of
    import-time) and adds a bit of encapsulation.
    TallJimbo committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    f130e09 View commit details
    Browse the repository at this point in the history
  19. Replace "tsRepr" with "TimespanReprClass"

    ...and similarly for regRepr->RegionReprClass.
    
    These symbols invariably refer to a type object that is a subclass of
    TimespanDatabaseRepresentation (or
    SpatialRegionDatabaseRepresentation).
    TallJimbo committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    1fe42b6 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    75c3c1f View commit details
    Browse the repository at this point in the history