Skip to content

Commit

Permalink
Merge pull request #347 from BradyAJohnston/fix-msgpack
Browse files Browse the repository at this point in the history
Fixes #345
  • Loading branch information
BradyAJohnston authored Nov 20, 2023
2 parents e430a22 + 3b65f53 commit c21e43f
Show file tree
Hide file tree
Showing 7 changed files with 440 additions and 437 deletions.
2 changes: 1 addition & 1 deletion molecularnodes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author" : "Brady Johnston",
"description" : "Toolbox for molecular animations in Blender & Geometry Nodes.",
"blender" : (3, 5, 0),
"version" : (2, 11, 0),
"version" : (2, 11, 2),
"location" : "Scene Properties -> Molecular Nodes",
"warning" : "",
"doc_url" : "https://bradyajohnston.github.io/MolecularNodes/",
Expand Down
5 changes: 2 additions & 3 deletions molecularnodes/bcif.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import warnings
from typing import Any, Dict, List, Optional, TypedDict, Union


def rotation_from_matrix(matrix):
Expand Down Expand Up @@ -149,10 +150,7 @@ def atom_array_from_bcif(open_bcif):
# - https://github.com/molstar/molstar/blob/master/src/mol-io/common/binary-cif/decoder.ts
# - https://github.com/molstar/molstar/blob/master/src/mol-io/reader/cif/binary/parser.ts

from typing import Any, Dict, List, Optional, TypedDict, Union

import msgpack
import numpy as np


class EncodingBase(TypedDict):
Expand Down Expand Up @@ -513,6 +511,7 @@ def loads(data: Union[bytes, EncodedFile], lazy=True) -> CifFile:
- True: individual columns are decoded only when accessed
- False: decode all columns immediately
"""
import msgpack

file: EncodedFile = data if isinstance(data, dict) and "dataBlocks" in data else msgpack.loads(data) # type: ignore

Expand Down
4 changes: 4 additions & 0 deletions molecularnodes/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ def MN_PT_panel_ui(layout_function, scene):
box.label(text = f"Please install '{name}' in the addon preferences.")
star.panel(box, scene)
elif panel_selection == 6:
if not pkg.is_current('biotite'):
box.enabled = False
box.alert = True
box.label(text = "Please install biotite in the addon preferences.")
pack.panel(box, scene)

class MN_PT_panel(bpy.types.Panel):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "molecularnodes"
version = "2.11.1"
version = "2.11.2"
description = "Toolbox for molecular animations with Blender and Geometry Nodes."
authors = ["Brady Johnston <[email protected]>"]
include = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[1 1 1 1 1 1 2 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1
1 2 1 1 2 1 1 2 1 1 1 2 1 1 1 1 1 1 1 2 1 1 2 2 1 2 1 1 1 1 1 1 1 2 1 1 1
2 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 2]
[1 1 1 1 1 2 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1
2 1 1 2 1 1 2 1 1 1 2 1 1 1 1 1 1 1 2 1 1 2 2 1 2 1 1 1 1 1 1 1 2 1 1 1 2
1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 2 1]
Loading

0 comments on commit c21e43f

Please sign in to comment.