DiMCAT Errors#
This notebook is a collection of errors. It serves as a resource to look up explanations for various kinds of errors and for other parts of the documentation to link to.
import dimcat as dc
package_path = "dcml_corpora.datapackage.json"
dataset = dc.Dataset.from_package(package_path)
dataset
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import dimcat as dc
3 package_path = "dcml_corpora.datapackage.json"
4 dataset = dc.Dataset.from_package(package_path)
File ~/checkouts/readthedocs.org/user_builds/dimcat/envs/latest/lib/python3.10/site-packages/dimcat/__init__.py:28
13 # modules of dimcat.data are not allowed to import from dimcat.steps, so when they do, they use get_class() which
14 # requires that the respective step was already "seen" and is part of the registry. Hence, although the main purpose
15 # of the imports here is syntactic sugar, some are required.
16 from .base import (
17 DimcatConfig,
18 change_setting,
(...)
26 reset_settings,
27 )
---> 28 from .data import catalogs, datasets, packages, resources
29 from .data.datasets.base import Dataset
30 from .data.resources import PieceIndex
File ~/checkouts/readthedocs.org/user_builds/dimcat/envs/latest/lib/python3.10/site-packages/dimcat/data/__init__.py:3
1 import logging
----> 3 from .resources import features
5 module_logger = logging.getLogger(__name__)
File ~/checkouts/readthedocs.org/user_builds/dimcat/envs/latest/lib/python3.10/site-packages/dimcat/data/resources/__init__.py:5
3 from .base import FeatureName, PathResource, Resource, ResourceStatus
4 from .dc import DimcatIndex, DimcatResource, Feature, PieceIndex
----> 5 from .features import (
6 Annotations,
7 HarmonyLabels,
8 KeyAnnotations,
9 Metadata,
10 Notes,
11 PhraseAnnotations,
12 PhraseComponents,
13 PhraseLabels,
14 )
15 from .results import (
16 CadenceCounts,
17 Counts,
(...)
24 Transitions,
25 )
27 module_logger = logging.getLogger(__name__)
File ~/checkouts/readthedocs.org/user_builds/dimcat/envs/latest/lib/python3.10/site-packages/dimcat/data/resources/features.py:23
14 from dimcat.data.resources.base import D, FeatureName, S
15 from dimcat.data.resources.dc import (
16 HARMONY_FEATURE_NAMES,
17 DimcatIndex,
(...)
21 UnitOfAnalysis,
22 )
---> 23 from dimcat.data.resources.results import PhraseData, PhraseDataFormat
24 from dimcat.data.resources.utils import (
25 get_corpus_display_name,
26 join_df_on_index,
27 merge_ties,
28 safe_row_tuple,
29 )
30 from dimcat.dc_exceptions import (
31 DataframeIsMissingExpectedColumnsError,
32 FeatureIsMissingFormatColumnError,
33 ResourceIsMissingPieceIndexError,
34 )
File ~/checkouts/readthedocs.org/user_builds/dimcat/envs/latest/lib/python3.10/site-packages/dimcat/data/resources/results.py:41
32 from dimcat.base import (
33 DimcatObjectField,
34 FriendlyEnum,
(...)
38 get_setting,
39 )
40 from dimcat.dc_exceptions import UnknownFormat
---> 41 from dimcat.plotting import (
42 CADENCE_COLORS,
43 GroupMode,
44 make_bar_plot,
45 make_bubble_plot,
46 make_heatmap,
47 make_lof_bar_plot,
48 make_lof_bubble_plot,
49 make_pie_chart,
50 update_figure_layout,
51 update_plot_grouping_settings,
52 write_image,
53 )
54 from dimcat.utils import SortOrder
55 from plotly import graph_objs as go
File ~/checkouts/readthedocs.org/user_builds/dimcat/envs/latest/lib/python3.10/site-packages/dimcat/plotting.py:16
14 from plotly import express as px
15 from plotly import graph_objects as go
---> 16 from plotly.validators.heatmap import ColorscaleValidator
18 AVAILABLE_FIGURE_FORMATS: Tuple[str, ...] = PlotlyScope._all_formats
19 """Possible formats for saving Plotly figures, defined as extensions without leading dot."""
ModuleNotFoundError: No module named 'plotly.validators.heatmap'
DimcatConfig Errors#
Invalid dtype#
config = dc.DimcatConfig(dtype="Bananas")
Invalid option#
The Counter analyzer has no option called invalid_option.
config = dc.DimcatConfig(dtype="Counter", invalid_option="Notes")
The Notes features has an option called format, but it does not accept the value "bananas".
config = dc.DimcatConfig(dtype="Notes", format="bananas")