syd 0.1.2__tar.gz → 0.1.3__tar.gz
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.
- {syd-0.1.2 → syd-0.1.3}/PKG-INFO +1 -1
- {syd-0.1.2 → syd-0.1.3}/pyproject.toml +1 -1
- syd-0.1.3/syd/__init__.py +1 -0
- {syd-0.1.2 → syd-0.1.3}/syd/interactive_viewer.py +3 -2
- {syd-0.1.2 → syd-0.1.3}/syd/notebook_deploy.py +2 -2
- {syd-0.1.2 → syd-0.1.3}/syd/parameters.py +1 -1
- syd-0.1.2/syd/__init__.py +0 -1
- {syd-0.1.2 → syd-0.1.3}/.gitignore +0 -0
- {syd-0.1.2 → syd-0.1.3}/LICENSE +0 -0
- {syd-0.1.2 → syd-0.1.3}/README.md +0 -0
{syd-0.1.2 → syd-0.1.3}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: syd
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: A Python package for making GUIs for data science easy.
|
|
5
5
|
Project-URL: Homepage, https://github.com/landoskape/syd
|
|
6
6
|
Author-email: Andrew Landau <andrew+tyler+landau+getridofthisanddtheplusses@gmail.com>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.3"
|
|
@@ -76,7 +76,7 @@ class InteractiveViewer:
|
|
|
76
76
|
self.state = {}
|
|
77
77
|
self._app_deployed = False
|
|
78
78
|
|
|
79
|
-
def
|
|
79
|
+
def get_state(self) -> Dict[str, Any]:
|
|
80
80
|
return {name: param.value for name, param in self.parameters.items()}
|
|
81
81
|
|
|
82
82
|
def plot(self, **kwargs) -> Figure:
|
|
@@ -94,8 +94,9 @@ class InteractiveViewer:
|
|
|
94
94
|
def perform_callbacks(self, name: str) -> bool:
|
|
95
95
|
"""Perform callbacks for all parameters that have changed"""
|
|
96
96
|
if name in self.callbacks:
|
|
97
|
+
state = self.get_state()
|
|
97
98
|
for callback in self.callbacks[name]:
|
|
98
|
-
callback(
|
|
99
|
+
callback(state)
|
|
99
100
|
|
|
100
101
|
def on_change(self, parameter_name: str, callback: Callable):
|
|
101
102
|
"""Register a function to be called when a parameter changes."""
|
|
@@ -220,7 +220,7 @@ class NotebookDeployment:
|
|
|
220
220
|
"""Update the plot with current parameters and size."""
|
|
221
221
|
self._current_fig.clear()
|
|
222
222
|
self._current_fig.set_size_inches(self.fig_width, self.fig_height)
|
|
223
|
-
self._current_fig = self.viewer.plot(fig=self._current_fig, state=self.viewer.
|
|
223
|
+
self._current_fig = self.viewer.plot(fig=self._current_fig, state=self.viewer.get_state())
|
|
224
224
|
|
|
225
225
|
# Apply tight layout to remove dead space
|
|
226
226
|
self._current_fig.tight_layout()
|
|
@@ -266,7 +266,7 @@ class NotebookDeployment:
|
|
|
266
266
|
# Create initial plot
|
|
267
267
|
self._current_fig = plt.figure(figsize=(self.fig_width, self.fig_height))
|
|
268
268
|
plt.close(self._current_fig) # close the figure to prevent it from being displayed
|
|
269
|
-
self._current_fig = self.viewer.plot(fig=self._current_fig, state=self.viewer.
|
|
269
|
+
self._current_fig = self.viewer.plot(fig=self._current_fig, state=self.viewer.get_state())
|
|
270
270
|
with self.plot_output:
|
|
271
271
|
display(self._current_fig)
|
|
272
272
|
|
|
@@ -182,7 +182,7 @@ class PairParameter(Parameter[Tuple[T, T]], ABC):
|
|
|
182
182
|
raise NotImplementedError("Need to define in subclass for proper IDE support")
|
|
183
183
|
|
|
184
184
|
@abstractmethod
|
|
185
|
-
def
|
|
185
|
+
def _validate(self, value: Any) -> T:
|
|
186
186
|
raise NotImplementedError
|
|
187
187
|
|
|
188
188
|
|
syd-0.1.2/syd/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.2"
|
|
File without changes
|
{syd-0.1.2 → syd-0.1.3}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|