dimcat.data package#
Subpackages#
- dimcat.data.catalogs package
- dimcat.data.datasets package
- dimcat.data.packages package
- dimcat.data.resources package
- Submodules
- dimcat.data.resources.base module
FeatureNameFeatureName.AnnotationsFeatureName.ArticulationFeatureName.BassNotesFeatureName.CadenceLabelsFeatureName.DcmlAnnotationsFeatureName.FeatureFeatureName.HarmonyLabelsFeatureName.KeyAnnotationsFeatureName.MeasuresFeatureName.MetadataFeatureName.NotesFeatureName.PhraseAnnotationsFeatureName.PhraseComponentsFeatureName.PhraseLabels
PathResourceResourceResource.IDResource.PickleSchemaResource.SchemaResource.basepathResource.copy()Resource.copy_to_new_location()Resource.corpus_nameResource.descriptor_existsResource.descriptor_filenameResource.detach_from_basepath()Resource.detach_from_descriptor()Resource.detach_from_filepath()Resource.filepathResource.from_descriptor()Resource.from_descriptor_path()Resource.from_filepath()Resource.from_resource()Resource.from_resource_path()Resource.get_corpus_name()Resource.get_descriptor_filename()Resource.get_descriptor_path()Resource.get_filepath()Resource.get_innerpath()Resource.get_path_dict()Resource.get_resource_name()Resource.innerpathResource.is_emptyResource.is_frozenResource.is_loadedResource.is_packagedResource.is_serializedResource.is_validResource.is_zippedResource.make_descriptor()Resource.normpathResource.resourceResource.resource_existsResource.resource_nameResource.set_basepath()Resource.set_descriptor_filename()Resource.statusResource.store_descriptor()Resource.to_dict()Resource.validate()
ResourceSchemaResourceStatusreconcile_base_and_file()resource_specs2resource()
- dimcat.data.resources.dc module
DimcatIndexDimcatIndex.PickleSchemaDimcatIndex.SchemaDimcatIndex.copy()DimcatIndex.filter()DimcatIndex.from_dataframe()DimcatIndex.from_grouping()DimcatIndex.from_index()DimcatIndex.from_resource()DimcatIndex.from_tuples()DimcatIndex.get_level_values_to_drop()DimcatIndex.indexDimcatIndex.namesDimcatIndex.piece_level_positionDimcatIndex.sample()DimcatIndex.to_resource()
DimcatResourceDimcatResource.SchemaDimcatResource.align_with_grouping()DimcatResource.apply_slice_intervals()DimcatResource.apply_step()DimcatResource.column_schemaDimcatResource.dataframeDimcatResource.default_groupbyDimcatResource.dfDimcatResource.extract_feature()DimcatResource.extractable_featuresDimcatResource.field_namesDimcatResource.filter_index_level()DimcatResource.formatDimcatResource.format_dataframe()DimcatResource.formatted_columnDimcatResource.from_dataframe()DimcatResource.from_descriptor()DimcatResource.from_descriptor_path()DimcatResource.from_filepath()DimcatResource.from_index()DimcatResource.from_resource()DimcatResource.from_resource_and_dataframe()DimcatResource.from_resource_path()DimcatResource.get_dataframe()DimcatResource.get_default_analysis()DimcatResource.get_default_column_names()DimcatResource.get_grouping_levels()DimcatResource.get_index()DimcatResource.get_interval_index()DimcatResource.get_level_names()DimcatResource.get_normpath()DimcatResource.get_piece_index()DimcatResource.get_slice_intervals()DimcatResource.get_time_spans()DimcatResource.has_distinct_formatted_columnDimcatResource.innerpathDimcatResource.is_emptyDimcatResource.is_loadedDimcatResource.is_validDimcatResource.join_on_index()DimcatResource.load()DimcatResource.make_bar_plot()DimcatResource.make_bubble_plot()DimcatResource.make_pie_chart()DimcatResource.metadataDimcatResource.plot()DimcatResource.plot_grouped()DimcatResource.set_basepath()DimcatResource.set_dataframe()DimcatResource.store_dataframe()DimcatResource.store_resource()DimcatResource.subselect()DimcatResource.summary_dict()DimcatResource.update_default_groupby()DimcatResource.validate()DimcatResource.value_column
FeatureIndexFieldPieceIndexPlaythroughSliceIntervalsUnitOfAnalysis
- dimcat.data.resources.facets module
- dimcat.data.resources.features module
- dimcat.data.resources.results module
- dimcat.data.resources.utils module
align_with_grouping()append_index_levels()apply_playthrough()apply_slice_intervals_to_resource_df()boolean_is_minor_column_to_mode()check_configs_against_allowed_configs()check_qstamp_columns()condense_dataframe_by_groups()condense_pedal_points()drop_duplicated_ultima_rows()drop_rows_with_missing_values()ensure_level_named_piece()feature_specs2config()features_argument2config_list()fl_fields2pandas_params()get_corpus_display_name()get_existing_normpath()get_time_spans_from_resource_df()infer_piece_col_position()infer_schema_from_df()insert_index_level()join_df_on_index()load_fl_resource()load_index_from_fl_resource()make_adjacency_groups()make_adjacency_mask()make_boolean_mask_from_set_of_tuples()make_frictionless_schema_descriptor()make_group_start_mask()make_groups_lasts_mask()make_groupwise_range_index_from_groups()make_index_from_grouping_dict()make_multiindex_for_unstack()make_phrase_start_mask()make_range_index_from_boolean_mask()make_regrouped_stage_index()make_tsv_resource()merge_columns_into_one()merge_ties()nan_eq()overlapping_chunk_per_interval_cutoff_direct()regroup_phrase_stages()resolve_columns_argument()resolve_join_str_argument()resolve_levels_argument()resolve_recognized_piece_columns_argument()safe_row_tuple()store_json()str2inttuple()str2pd_interval()subselect_multiindex_from_df()transform_phrase_data()transpose_notes_to_c()tuple2str()update_duration_qb()value2bool()
- Module contents
Submodules#
dimcat.data.base module#
- class dimcat.data.base.AbsolutePathStr[source]#
Bases:
strThis is just a string but if it includes the HOME directory, it is represented with a leading ‘~’.
- class dimcat.data.base.Data(basepath: Optional[str] = None)[source]#
Bases:
DimcatObjectThis base class unites all classes containing data in some way or another.
- class PickleSchema(*, only: Optional[Union[Sequence[str], AbstractSet[str]]] = None, exclude: Union[Sequence[str], AbstractSet[str]] = (), many: Optional[bool] = None, load_only: Union[Sequence[str], AbstractSet[str]] = (), dump_only: Union[Sequence[str], AbstractSet[str]] = (), partial: Optional[Union[bool, Sequence[str], AbstractSet[str]]] = None, unknown: Optional[Literal['exclude', 'include', 'raise']] = None)[source]#
Bases:
SchemaWhen serializing data objects, the basepath is used as location, but it is not included in the descriptor, according to the frictionless specification.
- exclude: set[Any] | MutableSet[Any]#
- unknown: types.UnknownOption#
- class Schema(*, only: Optional[Union[Sequence[str], AbstractSet[str]]] = None, exclude: Union[Sequence[str], AbstractSet[str]] = (), many: Optional[bool] = None, load_only: Union[Sequence[str], AbstractSet[str]] = (), dump_only: Union[Sequence[str], AbstractSet[str]] = (), partial: Optional[Union[bool, Sequence[str], AbstractSet[str]]] = None, unknown: Optional[Literal['exclude', 'include', 'raise']] = None)[source]#
Bases:
Schema- exclude: set[Any] | MutableSet[Any]#
- unknown: types.UnknownOption#
- get_basepath(set_default_if_missing: bool = False) str[source]#
Get the basepath of the resource. If not specified, the default basepath is returned. If
set_default_if_missingis set to True and no basepath has been set (e.g. during initialization), thebasepathis permanently set to the default basepath.
- class property pickle_schema[source]#
Returns the (instantiated) PickleSchema singleton object for this class. It is different from the ‘normal’ Schema in that it stores the tabular data to disk and returns the path to its descriptor.
- to_config(pickle=False) DimcatConfig[source]#
If
pickleis set to True,
- static treat_new_basepath(basepath: str, filepath=None, other_logger=None) AbsolutePathStr[source]#
- dimcat.data.base.resolve_path(path) Optional[AbsolutePathStr][source]#
Resolves ‘~’ to HOME directory and turns
pathinto an absolute path. This is an identical copy of the function in dimcat.utils.
dimcat.data.utils module#
- dimcat.data.utils.check_descriptor_filename_argument(descriptor_filename) str[source]#
Check if the descriptor_filename is a filename (not path) and warn if it doesn’t have the extension .json or .yaml.
- Parameters:
descriptor_filename –
- Raises:
ValueError – If the descriptor_filename is absolute.
- dimcat.data.utils.make_fl_resource(name: Optional[str] = None, **options) Resource[source]#
Creates a frictionless.Resource by passing the **options to the constructor.
- dimcat.data.utils.make_rel_path(path: str, start: str)[source]#
Like os.path.relpath() but ensures that path is contained within start.
- dimcat.data.utils.store_as_json_or_yaml(descriptor_dict: dict, descriptor_path: str, create_dirs: bool = True)[source]#