Skip to content

Commit 876562f

Browse files
committed
Upgrade higlass-schema
1 parent ebe660d commit 876562f

File tree

4 files changed

+49
-15
lines changed

4 files changed

+49
-15
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dynamic = ["version"]
2727
readme = "README.md"
2828
dependencies = [
2929
"servir>=0.0.5",
30-
"higlass-schema>=0.0.6",
30+
"higlass-schema>=0.2.0",
3131
"anywidget>=0.9.0",
3232
"jinja2",
3333
"jupyter-server-proxy>=3.0",

src/higlass/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def ensure_list(x: T | list[T] | None) -> list[T]:
7575

7676
def copy_unique(model: ModelT) -> ModelT:
7777
"""Creates a deep copy of a pydantic BaseModel with new UID."""
78-
copy = model.__class__(**model.dict())
78+
copy = model.__class__(**model.model_dump())
7979
if hasattr(copy, "uid"):
8080
setattr(copy, "uid", uid())
8181
return copy

src/higlass/api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ def mapper(view):
603603
raise ValueError("concat method must be 'vertical' or 'horizontal'.")
604604

605605
# gather views and adjust layout
606-
views = [v.copy(deep=True) for v in b.views]
606+
views = [v.model_copy(deep=True) for v in b.views]
607607
offset = 0 if a.views is None else max(map(mapper, a.views))
608608
for view in views:
609609
curr = getattr(view.layout, field)
@@ -616,7 +616,7 @@ def mapper(view):
616616
locks = getattr(b, lockattr)
617617
if locks:
618618
if getattr(a, lockattr) is None:
619-
setattr(a, lockattr, locks.copy(deep=True))
619+
setattr(a, lockattr, locks.model_copy(deep=True))
620620
else:
621621
getattr(a, lockattr).locksByViewUid.update(locks.locksByViewUid)
622622
getattr(a, lockattr).locksDict.update(locks.locksDict)
@@ -806,16 +806,16 @@ def combine(t1: Track, t2: Track, uid: str | None = None, **kwargs) -> CombinedT
806806
uid = utils.uid()
807807

808808
if isinstance(t1, CombinedTrack):
809-
copy = CombinedTrack(**t1.dict())
810-
copy.contents.append(t2.__class__(**t2.dict()))
809+
copy = CombinedTrack(**t1.model_dump())
810+
copy.contents.append(t2.__class__(**t2.model_dump()))
811811
for key, val in kwargs.items():
812812
setattr(copy, key, val)
813813
return copy
814814

815815
return CombinedTrack(
816816
type="combined",
817817
uid=uid,
818-
contents=[track.__class__(**track.dict()) for track in (t1, t2)],
818+
contents=[track.__class__(**track.model_dump()) for track in (t1, t2)],
819819
**kwargs,
820820
)
821821

uv.lock

Lines changed: 42 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)