Lossy#
- dace_query.lossy.lossy.Lossy: LossyClass = <dace_query.lossy.lossy.LossyClass object>#
This is a singleton instance of the
LossyClassclass.To use it, simply import it :
from dace_query.lossy import Lossy
- class dace_query.lossy.lossy.LossyClass(dace_instance=None)#
Bases:
objectThe lossy class. Use to retrieve data from the lossy module.
Tip
A lossy instance is already provided, to use it :
from dace_query.lossy import Lossy
- get_sample(sample_id, output_format=None)#
Get the data for a specific sample.
- Parameters:
sample_id (str) – The sample to retrieve data from.
output_format (dict[str, ndarray] or DataFrame or Table or dict) – Type of data returns
- Returns:
The desired data in the chosen output format
- Return type:
dict[str, ndarray] or DataFrame or Table or dict
Getting sample data for a given sample id
from dace_query.lossy import Lossy sample_id_to_retrieve = 'SAMPLE_Ice_LN2_11_20140221_000' values = Lossy.get_sample(sample_id=sample_id_to_retrieve)
- query_database(limit=10000, filters=None, sort=None, output_format=None)#
Query the lossy database to retrieve data in the chosen format.
Filters and sorting order can be applied to the query via named arguments (see Filtering and sorting).
All available formats are defined in this section (see Output formats).
- Parameters:
limit (Optional[int]) – Maximum number of rows to return
filters (Optional[dict]) – Filters to apply to the query
sort (Optional[dict]) – Sort order to apply to the query
output_format (Optional[str]) – Type of data returns
- Returns:
The desired data in the chosen output format
- Return type:
dict[str, ndarray] or DataFrame or Table or dict
Getting all data from the lossy database
from dace_query.lossy import Lossy values = Lossy.query_database()