lsst.dax.apdb g9290983e33+d2d81de7f7
 
Loading...
Searching...
No Matches
lsst.dax.apdb.tests._apdb.ApdbTest Class Reference
Inheritance diagram for lsst.dax.apdb.tests._apdb.ApdbTest:
lsst.dax.apdb.tests.utils.TestCaseMixin

Public Member Functions

ApdbConfig make_instance (self, **Any kwargs)
 
ApdbTables getDiaObjects_table (self)
 
Pixelization pixelization (self, ApdbConfig config)
 
None assert_catalog (self, Any catalog, int rows, ApdbTables table)
 
None assert_table_data (self, Any catalog, int rows, ApdbTables table)
 
None assert_column_types (self, Any catalog, dict[str, felis.datamodel.DataType] types)
 
Region make_region (self, tuple[float, float, float] xyz=(1.0, 1.0, -1.0))
 
None test_makeSchema (self)
 
None test_empty_gets (self)
 
None test_empty_gets_0months (self)
 
None test_storeObjects (self)
 
None test_storeObjects_empty (self)
 
None test_storeMovingObject (self)
 
None test_storeSources (self)
 
None test_storeForcedSources (self)
 
None test_timestamps (self)
 
None test_getChunks (self)
 
None test_reassignObjects (self)
 
None test_storeUpdateRecord (self)
 
None store_update_records (self, Apdb apdb, list[ApdbUpdateRecord] records, ReplicaChunk chunk)
 
None test_midpointMjdTai_src (self)
 
None test_midpointMjdTai_fsrc (self)
 
None test_metadata (self)
 
None test_schemaVersionFromYaml (self)
 
None test_config_freeze (self)
 

Static Public Attributes

 visit_time = astropy.time.Time("2021-01-01T00:00:00", format="isot", scale="tai")
 
bool fsrc_requires_id_list = False
 
bool enable_replica = False
 
bool use_mjd = True
 
int extra_chunk_columns = 1
 
int meta_row_count = 3
 
dict table_column_count
 

Detailed Description

Base class for Apdb tests that can be specialized for concrete
implementation.

This can only be used as a mixin class for a unittest.TestCase and it
calls various assert methods.

Member Function Documentation

◆ assert_catalog()

None lsst.dax.apdb.tests._apdb.ApdbTest.assert_catalog ( self,
Any catalog,
int rows,
ApdbTables table )
Validate catalog type and size

Parameters
----------
catalog : `object`
    Expected type of this is ``pandas.DataFrame``.
rows : `int`
    Expected number of rows in a catalog.
table : `ApdbTables`
    APDB table type.

◆ assert_table_data()

None lsst.dax.apdb.tests._apdb.ApdbTest.assert_table_data ( self,
Any catalog,
int rows,
ApdbTables table )
Validate catalog type and size

Parameters
----------
catalog : `object`
    Expected type of this is `ApdbTableData`.
rows : `int`
    Expected number of rows in a catalog.
table : `ApdbTables`
    APDB table type.
extra_columns : `int`
    Count of additional columns expected in ``catalog``.

◆ getDiaObjects_table()

ApdbTables lsst.dax.apdb.tests._apdb.ApdbTest.getDiaObjects_table ( self)
Return type of table returned from getDiaObjects method.

◆ make_instance()

ApdbConfig lsst.dax.apdb.tests._apdb.ApdbTest.make_instance ( self,
**Any kwargs )
Make database instance and return configuration for it.

◆ make_region()

Region lsst.dax.apdb.tests._apdb.ApdbTest.make_region ( self,
tuple[float, float, float] xyz = (1.0, 1.0, -1.0) )
Make a region to use in tests

◆ pixelization()

Pixelization lsst.dax.apdb.tests._apdb.ApdbTest.pixelization ( self,
ApdbConfig config )
Return pixelization used by implementation.

◆ store_update_records()

None lsst.dax.apdb.tests._apdb.ApdbTest.store_update_records ( self,
Apdb apdb,
list[ApdbUpdateRecord] records,
ReplicaChunk chunk )
Store update records in database, must be overriden in subclass.

◆ test_config_freeze()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_config_freeze ( self)
Test that some config fields are correctly frozen in database.

◆ test_empty_gets()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_empty_gets ( self)
Test for getting data from empty database.

All get() methods should return empty results, only useful for
checking that code is not broken.

◆ test_empty_gets_0months()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_empty_gets_0months ( self)
Test for getting data from empty database.

All get() methods should return empty DataFrame or None.

◆ test_getChunks()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_getChunks ( self)
Store and retrieve replica chunks.

◆ test_makeSchema()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_makeSchema ( self)
Test for making APDB schema.

◆ test_metadata()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_metadata ( self)
Simple test for writing/reading metadata table

◆ test_midpointMjdTai_fsrc()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_midpointMjdTai_fsrc ( self)
Test for time filtering of DiaForcedSources.

◆ test_midpointMjdTai_src()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_midpointMjdTai_src ( self)
Test for time filtering of DiaSources.

◆ test_reassignObjects()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_reassignObjects ( self)
Reassign DiaObjects.

◆ test_schemaVersionFromYaml()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_schemaVersionFromYaml ( self)
Check version number handling for reading schema from YAML.

◆ test_storeForcedSources()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_storeForcedSources ( self)
Store and retrieve DiaForcedSources.

◆ test_storeMovingObject()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_storeMovingObject ( self)
Store and retrieve DiaObject which changes its position.

◆ test_storeObjects()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_storeObjects ( self)
Store and retrieve DiaObjects.

◆ test_storeObjects_empty()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_storeObjects_empty ( self)
Test calling storeObject when there are no objects: see DM-43270.

◆ test_storeSources()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_storeSources ( self)
Store and retrieve DiaSources.

◆ test_storeUpdateRecord()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_storeUpdateRecord ( self)
Test _storeUpdateRecord() method.

◆ test_timestamps()

None lsst.dax.apdb.tests._apdb.ApdbTest.test_timestamps ( self)
Check that timestamp return type is as expected.

Member Data Documentation

◆ table_column_count

dict lsst.dax.apdb.tests._apdb.ApdbTest.table_column_count
static
Initial value:
= {
ApdbTables.DiaObject: 7,
ApdbTables.DiaObjectLast: 5,
ApdbTables.DiaSource: 12,
ApdbTables.DiaForcedSource: 8,
ApdbTables.SSObject: 3,
}

The documentation for this class was generated from the following file: