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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syd
3
- Version: 0.1.2
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>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "syd"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  authors = [
9
9
  {name = "Andrew Landau", email = "andrew+tyler+landau+getridofthisanddtheplusses@gmail.com"},
10
10
  ]
@@ -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 param_dict(self) -> Dict[str, Any]:
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(self.parameters[name].value)
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.param_dict())
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.param_dict())
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 _validate_value(self, value: Any) -> T:
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
File without changes
File without changes