scipion-pyworkflow 3.10.6__py3-none-any.whl → 3.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyworkflow/config.py +131 -67
- pyworkflow/constants.py +2 -1
- pyworkflow/plugin.py +93 -44
- pyworkflow/resources/showj/arrowDown.png +0 -0
- pyworkflow/resources/showj/arrowUp.png +0 -0
- pyworkflow/resources/showj/background_section.png +0 -0
- pyworkflow/resources/showj/colRowModeOff.png +0 -0
- pyworkflow/resources/showj/colRowModeOn.png +0 -0
- pyworkflow/resources/showj/delete.png +0 -0
- pyworkflow/resources/showj/doc_icon.png +0 -0
- pyworkflow/resources/showj/download_icon.png +0 -0
- pyworkflow/resources/showj/enabled_gallery.png +0 -0
- pyworkflow/resources/showj/galleryViewOff.png +0 -0
- pyworkflow/resources/showj/galleryViewOn.png +0 -0
- pyworkflow/resources/showj/goto.png +0 -0
- pyworkflow/resources/showj/menu.png +0 -0
- pyworkflow/resources/showj/separator.png +0 -0
- pyworkflow/resources/showj/tableViewOff.png +0 -0
- pyworkflow/resources/showj/tableViewOn.png +0 -0
- pyworkflow/resources/showj/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- pyworkflow/resources/showj/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- pyworkflow/resources/showj/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- pyworkflow/resources/showj/volumeOff.png +0 -0
- pyworkflow/resources/showj/volumeOn.png +0 -0
- pyworkflow/viewer.py +23 -1
- pyworkflowtests/protocols.py +1 -3
- {scipion_pyworkflow-3.10.6.dist-info → scipion_pyworkflow-3.11.0.dist-info}/METADATA +13 -27
- scipion_pyworkflow-3.11.0.dist-info/RECORD +71 -0
- {scipion_pyworkflow-3.10.6.dist-info → scipion_pyworkflow-3.11.0.dist-info}/WHEEL +1 -1
- pyworkflow/apps/__init__.py +0 -29
- pyworkflow/apps/pw_manager.py +0 -37
- pyworkflow/apps/pw_plot.py +0 -51
- pyworkflow/apps/pw_project.py +0 -113
- pyworkflow/apps/pw_protocol_list.py +0 -143
- pyworkflow/apps/pw_protocol_run.py +0 -51
- pyworkflow/apps/pw_run_tests.py +0 -267
- pyworkflow/apps/pw_schedule_run.py +0 -322
- pyworkflow/apps/pw_sleep.py +0 -37
- pyworkflow/apps/pw_sync_data.py +0 -439
- pyworkflow/apps/pw_viewer.py +0 -78
- pyworkflow/gui/__init__.py +0 -36
- pyworkflow/gui/browser.py +0 -726
- pyworkflow/gui/canvas.py +0 -1190
- pyworkflow/gui/dialog.py +0 -977
- pyworkflow/gui/form.py +0 -2637
- pyworkflow/gui/graph.py +0 -247
- pyworkflow/gui/graph_layout.py +0 -271
- pyworkflow/gui/gui.py +0 -566
- pyworkflow/gui/matplotlib_image.py +0 -233
- pyworkflow/gui/plotter.py +0 -247
- pyworkflow/gui/project/__init__.py +0 -25
- pyworkflow/gui/project/base.py +0 -192
- pyworkflow/gui/project/constants.py +0 -139
- pyworkflow/gui/project/labels.py +0 -205
- pyworkflow/gui/project/project.py +0 -492
- pyworkflow/gui/project/searchprotocol.py +0 -154
- pyworkflow/gui/project/searchrun.py +0 -181
- pyworkflow/gui/project/steps.py +0 -171
- pyworkflow/gui/project/utils.py +0 -332
- pyworkflow/gui/project/variables.py +0 -179
- pyworkflow/gui/project/viewdata.py +0 -472
- pyworkflow/gui/project/viewprojects.py +0 -510
- pyworkflow/gui/project/viewprotocols.py +0 -2093
- pyworkflow/gui/project/viewprotocols_extra.py +0 -559
- pyworkflow/gui/text.py +0 -771
- pyworkflow/gui/tooltip.py +0 -185
- pyworkflow/gui/tree.py +0 -684
- pyworkflow/gui/widgets.py +0 -307
- pyworkflow/mapper/__init__.py +0 -26
- pyworkflow/mapper/mapper.py +0 -222
- pyworkflow/mapper/sqlite.py +0 -1581
- pyworkflow/mapper/sqlite_db.py +0 -145
- pyworkflow/project/__init__.py +0 -31
- pyworkflow/project/config.py +0 -454
- pyworkflow/project/manager.py +0 -180
- pyworkflow/project/project.py +0 -2007
- pyworkflow/protocol/__init__.py +0 -38
- pyworkflow/protocol/bibtex.py +0 -48
- pyworkflow/protocol/constants.py +0 -87
- pyworkflow/protocol/executor.py +0 -471
- pyworkflow/protocol/hosts.py +0 -314
- pyworkflow/protocol/launch.py +0 -270
- pyworkflow/protocol/package.py +0 -42
- pyworkflow/protocol/params.py +0 -741
- pyworkflow/protocol/protocol.py +0 -2641
- pyworkflow/tests/__init__.py +0 -29
- pyworkflow/tests/test_utils.py +0 -25
- pyworkflow/tests/tests.py +0 -341
- pyworkflow/utils/__init__.py +0 -38
- pyworkflow/utils/dataset.py +0 -414
- pyworkflow/utils/echo.py +0 -104
- pyworkflow/utils/graph.py +0 -169
- pyworkflow/utils/log.py +0 -284
- pyworkflow/utils/path.py +0 -528
- pyworkflow/utils/process.py +0 -153
- pyworkflow/utils/profiler.py +0 -92
- pyworkflow/utils/progressbar.py +0 -154
- pyworkflow/utils/properties.py +0 -631
- pyworkflow/utils/reflection.py +0 -129
- pyworkflow/utils/utils.py +0 -879
- pyworkflow/utils/which.py +0 -229
- pyworkflow/webservices/__init__.py +0 -8
- pyworkflow/webservices/config.py +0 -11
- pyworkflow/webservices/notifier.py +0 -162
- pyworkflow/webservices/repository.py +0 -59
- pyworkflow/webservices/workflowhub.py +0 -74
- pyworkflowtests/tests/__init__.py +0 -0
- pyworkflowtests/tests/test_canvas.py +0 -72
- pyworkflowtests/tests/test_domain.py +0 -45
- pyworkflowtests/tests/test_logs.py +0 -74
- pyworkflowtests/tests/test_mappers.py +0 -392
- pyworkflowtests/tests/test_object.py +0 -507
- pyworkflowtests/tests/test_project.py +0 -42
- pyworkflowtests/tests/test_protocol_execution.py +0 -142
- pyworkflowtests/tests/test_protocol_export.py +0 -78
- pyworkflowtests/tests/test_protocol_output.py +0 -158
- pyworkflowtests/tests/test_streaming.py +0 -47
- pyworkflowtests/tests/test_utils.py +0 -210
- scipion_pyworkflow-3.10.6.dist-info/RECORD +0 -140
- scipion_pyworkflow-3.10.6.dist-info/dependency_links.txt +0 -1
- {scipion_pyworkflow-3.10.6.dist-info → scipion_pyworkflow-3.11.0.dist-info}/entry_points.txt +0 -0
- {scipion_pyworkflow-3.10.6.dist-info → scipion_pyworkflow-3.11.0.dist-info}/licenses/LICENSE.txt +0 -0
- {scipion_pyworkflow-3.10.6.dist-info → scipion_pyworkflow-3.11.0.dist-info}/top_level.txt +0 -0
pyworkflow/utils/reflection.py
DELETED
@@ -1,129 +0,0 @@
|
|
1
|
-
# **************************************************************************
|
2
|
-
# *
|
3
|
-
# * Authors: J.M. De la Rosa Trevin (jmdelarosa@cnb.csic.es)
|
4
|
-
# *
|
5
|
-
# * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
|
6
|
-
# *
|
7
|
-
# * This program is free software; you can redistribute it and/or modify
|
8
|
-
# * it under the terms of the GNU General Public License as published by
|
9
|
-
# * the Free Software Foundation; either version 3 of the License, or
|
10
|
-
# * (at your option) any later version.
|
11
|
-
# *
|
12
|
-
# * This program is distributed in the hope that it will be useful,
|
13
|
-
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
# * GNU General Public License for more details.
|
16
|
-
# *
|
17
|
-
# * You should have received a copy of the GNU General Public License
|
18
|
-
# * along with this program; if not, write to the Free Software
|
19
|
-
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
20
|
-
# * 02111-1307 USA
|
21
|
-
# *
|
22
|
-
# * All comments concerning this program package may be sent to the
|
23
|
-
# * e-mail address 'scipion@cnb.csic.es'
|
24
|
-
# *
|
25
|
-
# **************************************************************************
|
26
|
-
"""
|
27
|
-
This module contains reflection utilities
|
28
|
-
(dynamically load classes, inspect object properties and others)
|
29
|
-
"""
|
30
|
-
|
31
|
-
import os
|
32
|
-
from os.path import exists, join
|
33
|
-
import sys
|
34
|
-
from inspect import isclass
|
35
|
-
|
36
|
-
|
37
|
-
def getModules(path):
|
38
|
-
""" Try to find possible sub-modules under path.
|
39
|
-
A dictionary will be returned with modules names
|
40
|
-
as keys and the modules objects as values.
|
41
|
-
"""
|
42
|
-
sys.path.append(path)
|
43
|
-
folders = os.listdir(path)
|
44
|
-
modules = {}
|
45
|
-
|
46
|
-
for f in folders:
|
47
|
-
if exists(join(path, f, '__init__.py')):
|
48
|
-
try:
|
49
|
-
m = __import__(f)
|
50
|
-
modules[f] = m
|
51
|
-
checkPlugin(m)
|
52
|
-
except Exception as ex:
|
53
|
-
print(">>> Error loading module: '%s'" % f)
|
54
|
-
print(">>> Exception: ", ex)
|
55
|
-
import traceback
|
56
|
-
traceback.print_exc()
|
57
|
-
|
58
|
-
return modules
|
59
|
-
|
60
|
-
|
61
|
-
def getSubclassesFromModules(BaseClass, modules, debug=False):
|
62
|
-
""" Find subclasses of BaseClass from a give dict of modules.
|
63
|
-
"""
|
64
|
-
subclasses = {}
|
65
|
-
|
66
|
-
for m in modules.values():
|
67
|
-
if debug:
|
68
|
-
print("loading module: ", m.__name__)
|
69
|
-
subDict = getSubclasses(BaseClass, m.__dict__)
|
70
|
-
|
71
|
-
for subclass in subDict.values():
|
72
|
-
# some protocols have pyworkflow.em.packages. in the __module__ and other no
|
73
|
-
moduleName = subclass.__module__.replace('pwem.packages.', '')
|
74
|
-
if moduleName.startswith(m.__name__):
|
75
|
-
subclass._package = m
|
76
|
-
if debug:
|
77
|
-
print(" found: ", subclass.__name__, "module: ", subclass.__module__)
|
78
|
-
subclasses.update(subDict)
|
79
|
-
|
80
|
-
return subclasses
|
81
|
-
|
82
|
-
|
83
|
-
def getSubclassesFromPath(BaseClass, path):
|
84
|
-
""" Try to find possible sub-packages under path
|
85
|
-
and find subclasses of BaseClass from them
|
86
|
-
Return a dictionary containing the subclasses.
|
87
|
-
"""
|
88
|
-
modules = getModules(path)
|
89
|
-
return getSubclassesFromModules(BaseClass, modules)
|
90
|
-
|
91
|
-
|
92
|
-
def getSubclasses(BaseClass, inputDict):
|
93
|
-
""" Iterate over inputDict and find all subclasses
|
94
|
-
of BaseClass, that will be set in outputDict.
|
95
|
-
"""
|
96
|
-
outputDict = {}
|
97
|
-
for k, v in inputDict.items():
|
98
|
-
# Do not add the base class that is imported in all modules
|
99
|
-
if (not v==BaseClass) and isclass(v) and issubclass(v, BaseClass):
|
100
|
-
outputDict[k] = v
|
101
|
-
return outputDict
|
102
|
-
|
103
|
-
|
104
|
-
def checkPlugin(module):
|
105
|
-
if not getattr(module, '_plugin', None):
|
106
|
-
print('WARNING: module "%s" using old package structure, '
|
107
|
-
'_plugin attribute missing' % module.__name__)
|
108
|
-
|
109
|
-
|
110
|
-
def isSameFunction(function1, function2):
|
111
|
-
""" Check if the content of 2 functions is the same.
|
112
|
-
This could be used to check if a method has been overridden or not
|
113
|
-
From https://stackoverflow.com/questions/13620542/detecting-empty-function-definitions-in-python"""
|
114
|
-
return function1.__code__.co_code == function2.__code__.co_code
|
115
|
-
|
116
|
-
|
117
|
-
def isModuleAFolder(modulename):
|
118
|
-
""" Returns True if a python module is a folder"""
|
119
|
-
# So far e can test for the filename
|
120
|
-
module = sys.modules[modulename]
|
121
|
-
|
122
|
-
return module.__file__.endswith("__init__.py")
|
123
|
-
|
124
|
-
|
125
|
-
def isModuleLoaded(modulename):
|
126
|
-
"""
|
127
|
-
Return True if a python module is loaded, False otherwise
|
128
|
-
"""
|
129
|
-
return modulename in sys.modules
|