database¶
db¶
-
class
decitala.database.db.
CompositionData
(name, part_num, local_filepath)[source]¶ Bases:
sqlalchemy.orm.decl_api.Base
SQLAlchemy model representing the basic composition data for a composition.
- Parameters
name (str) – Name of the composition.
part_num (int) – Part number for the extraction.
local_filepath (str) – Local filepath for the searched composition.
TODO: could add a search_constraint column that stores a JSON of the rolling_search parameters.
-
class
decitala.database.db.
ExtractionData
(fragment, onset_start, onset_stop, retrograde, factor, difference, mod_hierarchy_val, pitch_content, is_spanned_by_slur, slur_count, slur_start_end_count, id_, contiguous_summation)[source]¶ Bases:
sqlalchemy.orm.decl_api.Base
SQLAlchemy model representing a fragment extracted from a composition. Intended to be used with the class method
ExtractionData.from_extraction
. Seedecitala.search.Extraction
for the relevant information on each column in the database.-
classmethod
from_extraction
(extraction)[source]¶ Creates an
decitala.database.db.ExtractionData
object from adecitala.search.Extraction
object. This is more durable to accidentally breaking things when adding data to extractions.
-
classmethod
-
decitala.database.db.
create_extraction_database
(db_path, filepath, table, part_nums=[0], windows=[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], verbose=False)[source]¶ Function for creating a database from a single filepath. Stores all extracted fragments.
- Parameters
db_path (str) – Path to the database to be created.
filepath (str) – Path to the score to be analyzed.
table (list) – A
decitala.hash_table.FragmentHashTable
object.part_nums (list) – Parts to be analyzed.
windows (list) – Possible lengths of the search frames.
verbose (bool) – Whether to log the SQL calls. False by default.
-
decitala.database.db.
batch_create_extraction_database
(db_path, data_in, table, windows, verbose=False)[source]¶ This function creates a database from a dictionary of filepaths and desires
part_nums
to analyze.- Parameters
db_path (str) – Path to the database to be created.
data_in (dict) – Dictionary of filepaths (key) and part nums in a list (value).
table (list) – A
decitala.hash_table.FragmentHashTable
object.windows (list) – Possible lengths of the search frames.
verbose (bool) – Whether to log the SQL calls. False by default.
-
decitala.database.db.
create_path_database
(db_path, filepath, part_nums, table, windows=[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], allow_subdivision=False, allow_contiguous_summation=False, algorithm='dijkstra', cost_function_class=<decitala.path_finding.path_finding_utils.CostFunction3D object>, split_dict=None, slur_constraint=False, enforce_earliest_start=False, verbose=False)[source]¶ Function for creating a database from a single filepath. Stores the extracted path. See
decitala.search.path_finder
to find the definitions of the relevant parameters.- Parameters
db_path (str) – Path to the database to be created.
-
decitala.database.db.
batch_create_path_database
(db_path, data_in, table, windows=[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], allow_subdivision=False, allow_contiguous_summation=False, algorithm='dijkstra', cost_function_class=<decitala.path_finding.path_finding_utils.CostFunction3D object>, split_dict=None, slur_constraint=False, enforce_earliest_start=False, verbose=False)[source]¶ This function creates a database from a dictionary of filepaths and desires
part_nums
to analyze. Seedecitala.search.path_finder
to find the definitions of the relevant parameters.- Parameters
db_path (str) – Path to the database to be created.
data_in (dict) – Dictionary of filepaths (key) and part nums in a list (value).
corpora_models¶
-
class
decitala.database.corpora_models.
DecitalaData
(**kwargs)[source]¶ Bases:
sqlalchemy.orm.decl_api.Base
SQLAlchemy model representing a decitala fragment from the encoded datasets (given in
corpora
).
-
class
decitala.database.corpora_models.
GreekFootData
(**kwargs)[source]¶ Bases:
sqlalchemy.orm.decl_api.Base
SQLAlchemy model representing a greek foot fragment from the encoded datasets (given in
corpora
).
-
class
decitala.database.corpora_models.
ProsodicMeterData
(**kwargs)[source]¶ Bases:
sqlalchemy.orm.decl_api.Base
SQLAlchemy model representing a prosodic meter from the encoded datasets (given in
corpora
).
-
class
decitala.database.corpora_models.
CategoryData
(**kwargs)[source]¶ Bases:
sqlalchemy.orm.decl_api.Base
Category table of the database, (possibly) holding multiple subcategories, i.e., species.