File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 14
14
)
15
15
16
16
import higlass_schema as hgs
17
- from pydantic import BaseModel
17
+ from pydantic import RootModel
18
18
19
19
import higlass ._display as display
20
20
import higlass ._utils as utils
21
21
22
22
__all__ = [
23
+ "CombinedTrack" ,
23
24
"EnumTrack" ,
24
25
"HeatmapTrack" ,
25
26
"IndependentViewportProjectionTrack" ,
26
- "CombinedTrack" ,
27
27
"PluginTrack" ,
28
28
"TrackT" ,
29
29
"View" ,
30
30
"ViewT" ,
31
31
"Viewconf" ,
32
+ "combine" ,
32
33
"concat" ,
34
+ "divide" ,
33
35
"hconcat" ,
34
- "vconcat " ,
36
+ "lock " ,
35
37
"track" ,
38
+ "vconcat" ,
36
39
"view" ,
37
- "combine" ,
38
- "divide" ,
39
- "lock" ,
40
40
]
41
41
42
42
if TYPE_CHECKING :
@@ -634,18 +634,18 @@ def mapper(view):
634
634
# TODO: register plugins globally to work here?
635
635
636
636
637
- class _TrackCreator (BaseModel ):
637
+ class _TrackCreator (RootModel ):
638
638
"""Create track instances from their track type.
639
639
640
640
Used internally by `hg.track` to leverage pydantic's ability to get
641
641
the appropriate base model by the track type.
642
642
643
643
Example:
644
644
-------
645
- >>> assert isinstance(_TrackCreator(type="heatmap").__root__ , HeatmapTrack)
645
+ >>> assert isinstance(_TrackCreator(type="heatmap").root , HeatmapTrack)
646
646
"""
647
647
648
- __root__ : Track
648
+ root : Track
649
649
650
650
651
651
@overload
@@ -688,7 +688,7 @@ def track(
688
688
if uid is None :
689
689
uid = utils .uid ()
690
690
data = dict (type = type_ , uid = uid , ** kwargs )
691
- return _TrackCreator .parse_obj (data ).__root__
691
+ return _TrackCreator .model_validate (data ).root
692
692
693
693
694
694
def view (
You can’t perform that action at this time.
0 commit comments