diff --git a/src/bundles/mmcif/src/__init__.py b/src/bundles/mmcif/src/__init__.py
index e68440e..7142686 100644
a
|
b
|
from .mmcif import (
|
21 | 21 | |
22 | 22 | from chimerax.core.toolshed import BundleAPI |
23 | 23 | |
| 24 | def _fetch_wrapper_dummy(fetch_func): |
| 25 | def fetch(session, pdb_id, fetch_source='rcsb', ignore_cache=False, |
| 26 | structure_factors=False, over_sampling=1.5, **kw): |
| 27 | if structure_factors: |
| 28 | from chimerax.core.errors import UserError |
| 29 | raise UserError('Loading structure factors requires the ChimeraX-Clipper plugin ' |
| 30 | 'available from the Tool Shed.') |
| 31 | return fetch_func(session, pdb_id, ignore_cache=ignore_cache, **kw) |
| 32 | return fetch |
| 33 | |
24 | 34 | |
25 | 35 | class _PDBioAPI(BundleAPI): |
26 | 36 | |
… |
… |
class _PDBioAPI(BundleAPI):
|
42 | 52 | from chimerax.core.errors import UserError |
43 | 53 | raise UserError("Unknown database for fetching mmCIF: '%s'. Known databases are: %s" |
44 | 54 | % (database_name, ", ".join(list(fetchers.keys())))) |
45 | | return fetcher(session, identifier, ignore_cache=ignore_cache, **kw) |
| 55 | try: |
| 56 | from chimerax.clipper.io import fetch_cif |
| 57 | return fetch_cif.fetch_wrapper(fetcher)(session, identifier, ignore_cache=ignore_cache, **kw) |
| 58 | except ImportError: |
| 59 | return _fetch_wrapper_dummy(fetcher)(session, identifier, ignore_cache=ignore_cache, **kw) |
46 | 60 | |
47 | 61 | @staticmethod |
48 | 62 | def open_file(session, path, file_name, *, auto_style=True, coordsets=False, atomic=True, |
49 | | max_models=None, log_info=True, combine_sym_atoms=True): |
| 63 | max_models=None, log_info=True, combine_sym_atoms=True, |
| 64 | structure_factors=False, over_sampling=None): |
50 | 65 | # 'open_file' is called by session code to open a file |
51 | 66 | # returns (list of models, status message) |
| 67 | if structure_factors or over_sampling: |
| 68 | from chimerax.core.errors import UserError |
| 69 | raise UserError('structureFactors and overSampling arguments are only ' |
| 70 | 'valid when fetching models from an online database.') |
| 71 | |
52 | 72 | from . import mmcif |
53 | 73 | return mmcif.open_mmcif(session, path, file_name, auto_style=auto_style, |
54 | 74 | coordsets=coordsets, atomic=atomic, max_models=max_models, |