Skip to content

Commit

Permalink
Merge pull request #368 from BradyAJohnston/367-scipy-dependencies
Browse files Browse the repository at this point in the history
relax requirement for scipy for import, only for biological assemblies
  • Loading branch information
BradyAJohnston authored Dec 1, 2023
2 parents 800b77e + 3a27466 commit b07ec24
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 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" : (4, 0, 0),
"version" : (4, 0, 2),
"version" : (4, 0, 3),
"location" : "Scene Properties -> Molecular Nodes",
"warning" : "",
"doc_url" : "https://bradyajohnston.github.io/MolecularNodes/",
Expand Down
8 changes: 6 additions & 2 deletions molecularnodes/io/local.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import bpy
import warnings
from .. import assembly
from .. import assembly, pkg
from .load import create_molecule
from ..blender import (
nodes
Expand Down Expand Up @@ -162,6 +162,10 @@ def panel(layout, scene):
layout.prop(scene, "MN_import_style")
grid = layout.grid_flow()

grid.prop(scene, 'MN_import_build_assembly')
row = grid.row().column()
if not pkg.is_current('scipy'):
row.enabled = False
row.label(text = 'For assemblies, install scipy in add-on preferences.')
row.prop(scene, 'MN_import_build_assembly')
grid.prop(scene, 'MN_import_centre', icon_value=0)
grid.prop(scene, 'MN_import_del_solvent', icon_value=0)
12 changes: 8 additions & 4 deletions molecularnodes/io/pdb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import bpy
from pathlib import Path
import numpy as np

from .. import pkg
from .load import create_molecule
from ..blender import nodes
from .. import assembly
Expand Down Expand Up @@ -179,6 +179,10 @@ def panel(layout, scene):
col.prop(scene, 'MN_cache_dir', text = "Cache")
col.enabled = scene.MN_cache
grid = options.grid_flow()
for property in ['MN_import_build_assembly', 'MN_import_centre', 'MN_import_del_solvent']:
grid.prop(scene, property)

row = grid.row().column()
if not pkg.is_current('scipy'):
row.enabled = False
row.label(text = 'For assemblies, install scipy in add-on preferences.')
row.prop(scene, 'MN_import_build_assembly')
grid.prop(scene, 'MN_import_centre')
grid.prop(scene, 'MN_import_del_solvent')
4 changes: 2 additions & 2 deletions molecularnodes/ui/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
}

packages = {
'pdb': ['biotite', 'scipy'],
'pdb': ['biotite'],
'star': ['starfile', 'eulerangles'],
'local': ['biotite', 'scipy'],
'local': ['biotite'],
'cellpack': ['biotite', 'msgpack', 'scipy'],
'md': ['MDAnalysis'],
'density': ['mrcfile', 'scipy'],
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 = "4.0.2"
version = "4.0.3"
description = "Toolbox for molecular animations with Blender and Geometry Nodes."
authors = ["Brady Johnston <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit b07ec24

Please sign in to comment.