lcc.data_manager package

Submodules

lcc.data_manager.filter_serializer module

class lcc.data_manager.filter_serializer.FiltersSerializer(file_name, path)[source]

Bases: object

This class is responsible for saving and reconstructing filter objects from files

Attributes

file_name (str) Name of the filter name
path (str) Path to the filter location

Methods

loadFilter()[source]

Get stars filter object

Returns:

BaseFilter instance

Constructed filter object

saveFilter(star_filter)[source]
Parameters:

star_filter : BaseFilter instance

Save object as pickle

Returns:

None

lcc.data_manager.package_reader module

class lcc.data_manager.package_reader.PackageReader[source]

Bases: object

Class for managing modules and its classes in the package

Attributes

MODULE_EXTENSION (iterable) Accepted extensions of module files.
NAMES (dict) Keys are identifiers for path to the package where searched classes are located and base filter which all package classes needs to inherit in order to be accepted.
EXCLUDE (iterable) File names (first letters of them) which will be excluded.

Methods

EXCLUDE = ()
MODULE_EXTENSIONS = ('.py',)
NAMES = {'descriptors': ('lcc/stars_processing/descriptors', <class 'lcc.stars_processing.utilities.base_descriptor.BaseDescriptor'>), 'connectors': ('lcc/db_tier/connectors', <class 'lcc.db_tier.base_query.StarsCatalogue'>), 'deciders': ('lcc/stars_processing/deciders', <class 'lcc.stars_processing.utilities.base_decider.BaseDecider'>), 'unsup_deciders': ('lcc/stars_processing/deciders/unsupervised', <class 'lcc.stars_processing.utilities.base_decider.BaseDecider'>)}
classmethod getClasses(name)[source]

Get all classes in the package which inherit base classes according to NAME attribute

Parameters:

name : str

Key in NAME dictionary to package location and parent class

Returns:

list

List of all classes in the package which inherit base classes according to NAME attribute

classmethod getClassesDict(package_name)[source]

Get dictionary of all classes in the package which inherit base classes according to NAME attribute

Parameters:

package_name : str

Key in NAME dictionary to package location and parent class

Returns:

dict

Dictionary of all classes in the package which inherit base classes according to NAME attribute

classmethod getModuleClasses(module)[source]
Parameters:

module : module

Module object

Returns:

list

List of classes in the module

classmethod getPackageContents(package_name)[source]

Get all modules in the package

Parameters:

package_name : str

Name of the target package specified in NAMES attribute

Returns:

set

Set of module names in the package

lcc.data_manager.prepare_package module

lcc.data_manager.prepare_package.prepare_run(directory, run_name)[source]
lcc.data_manager.prepare_package.rec(directory, current_path)[source]
lcc.data_manager.prepare_package.tree()[source]

lcc.data_manager.status_resolver module

class lcc.data_manager.status_resolver.StatusResolver(status_file_path)[source]

Bases: object

This class is responsible for status files generated thru systematic searches into databases and for reading files of planned queries.

Attributes

status_header (list) Column names of status file
status_queries (list) Rows of status file

Methods

DELIMITER = ';'
NUM_STATUS_INFO = 4
getQueries()[source]

Get status file as list of queries

Returns:

list

List of dictionary queries

classmethod getUnsearchedQuery(search_plan_file)[source]

Return list of queries which have not been queried yet.

Parameters:

Search_plan_file : str

Path to the file of planned queries

Returns:

list

List of query dictionaries

getWithStatus(stat)[source]

Get queries with given query status

Parameters:

stat : dict

Dictionary with status column name and its value

Returns:

list

Returns all queries with desired status

static get_with_status(queries, stat={'passed': True})[source]

Return all queries with desired status

Parameters:

stat : dict

Dictionary with status column name and its value

queries : list

List of query dictionaries

Returns:

list

Returns all queries with desired status

classmethod save_lists_query(query=[], fi_name='query_file.txt', PATH='.', DELIM=None, overwrite=False, header=None)[source]

Save queries into the file which can be loaded for another query

Parameters:

query : list

List of lists which contains

Returns:

None

classmethod save_query(query, fi_name='query_file.txt', PATH='.', DELIM=None, overwrite=False)[source]

Save queries into the file which can be loaded for another query

Parameters:

query : list

List of dictionaries which contains query params

Returns:

None

Module contents