syd 1.2.3__py3-none-any.whl → 1.2.5__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.
syd/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "1.2.3"
1
+ __version__ = "1.2.5"
2
2
 
3
3
  from .viewer import make_viewer, Viewer
4
4
  from .support import show_open_servers, close_servers
@@ -97,6 +97,7 @@ class FlaskLayoutConfig:
97
97
 
98
98
  controls_position: str = "left" # Options are: 'left', 'top', 'right', 'bottom'
99
99
  controls_width_percent: int = 15
100
+ plot_margin_percent: float = 10
100
101
 
101
102
  def __post_init__(self):
102
103
  valid_positions = ["left", "top", "right", "bottom"]
@@ -121,10 +122,11 @@ class FlaskDeployer:
121
122
  viewer: Viewer,
122
123
  controls_position: str = "left",
123
124
  fig_dpi: int = 300,
124
- controls_width_percent: int = 15,
125
+ controls_width_percent: int = 20,
126
+ plot_margin_percent: float = 2.5,
125
127
  suppress_warnings: bool = True,
126
128
  debug: bool = False,
127
- host: str = "127.0.0.1",
129
+ host: Optional[str] = None,
128
130
  port: Optional[int] = None,
129
131
  open_browser: bool = True,
130
132
  update_threshold: float = 1.0,
@@ -147,6 +149,8 @@ class FlaskDeployer:
147
149
  Approximate height for template layout guidance (inches)
148
150
  controls_width_percent : int, optional
149
151
  Width of the controls panel as a percentage of the total width
152
+ plot_margin_percent : float, optional
153
+ Margin around the plot (inches)
150
154
  suppress_warnings : bool, optional
151
155
  Whether to suppress ParameterUpdateWarning during updates
152
156
  debug : bool, optional
@@ -172,6 +176,7 @@ class FlaskDeployer:
172
176
  self.config = FlaskLayoutConfig(
173
177
  controls_position=controls_position,
174
178
  controls_width_percent=controls_width_percent,
179
+ plot_margin_percent=plot_margin_percent,
175
180
  )
176
181
  self.fig_dpi = fig_dpi
177
182
  self.debug = debug
@@ -381,7 +386,7 @@ class FlaskDeployer:
381
386
 
382
387
  def display(
383
388
  self,
384
- host: str = "127.0.0.1",
389
+ host: Optional[str] = None,
385
390
  port: Optional[int] = None,
386
391
  open_browser: bool = True,
387
392
  ) -> None:
@@ -393,7 +398,7 @@ class FlaskDeployer:
393
398
 
394
399
  # Find an available port if none is specified
395
400
  self.port = port or _find_available_port()
396
- self.host = host
401
+ self.host = host or socket.gethostbyname(socket.gethostname())
397
402
  self.url = f"http://{self.host}:{self.port}"
398
403
  print(f" * Syd Flask server running on {self.url}")
399
404
 
@@ -44,15 +44,12 @@ document.addEventListener('DOMContentLoaded', async () => {
44
44
  await fetchInitialData();
45
45
  createControls(); // Populates #parameter-controls
46
46
  if (['left', 'right'].includes(config.controlsPosition)) {
47
- // Pass the already created systemControls element
48
47
  createSystemControls(systemControls); // Populates #system-controls
49
48
  }
50
49
  updatePlot();
51
50
  updateStatus('Ready!');
52
51
  } catch (error) {
53
52
  console.error("Initialization failed:", error);
54
- // Status might have already been updated by the failing function (e.g., fetchInitialData)
55
- // If not, uncomment the line below:
56
- // updateStatus('Initialization failed.');
53
+ updateStatus('Initialization failed.');
57
54
  }
58
55
  });
@@ -23,10 +23,9 @@
23
23
 
24
24
  <!-- Store config as data attributes for JS to access -->
25
25
  <div id="viewer-config"
26
- data-figure-width="{{ config.figure_width }}"
27
- data-figure-height="{{ config.figure_height }}"
28
26
  data-controls-position="{{ config.controls_position }}"
29
27
  data-controls-width-percent="{{ config.controls_width_percent }}"
28
+ data-plot-margin-percent="{{ config.plot_margin_percent }}"
30
29
  style="display:none;"></div>
31
30
 
32
31
  <script type="module" src="{{ url_for('static', filename='js/viewer.js') }}"></script>
syd/viewer.py CHANGED
@@ -276,9 +276,10 @@ class Viewer:
276
276
  controls_position: str = "left",
277
277
  fig_dpi: int = 300,
278
278
  controls_width_percent: int = 20,
279
+ plot_margin_percent: float = 2.5,
279
280
  suppress_warnings: bool = True,
280
281
  debug: bool = False,
281
- host: str = "127.0.0.1",
282
+ host: Optional[str] = None,
282
283
  port: Optional[int] = None,
283
284
  open_browser: bool = True,
284
285
  update_threshold: float = 1.0,
@@ -293,6 +294,7 @@ class Viewer:
293
294
  controls_position=controls_position,
294
295
  fig_dpi=fig_dpi,
295
296
  controls_width_percent=controls_width_percent,
297
+ plot_margin_percent=plot_margin_percent,
296
298
  suppress_warnings=suppress_warnings,
297
299
  debug=debug,
298
300
  host=host,
@@ -319,8 +321,6 @@ class Viewer:
319
321
 
320
322
  if "port" not in kwargs:
321
323
  kwargs["port"] = None
322
- if "continuous" in kwargs:
323
- kwargs.pop("continuous")
324
324
 
325
325
  deployer = FlaskDeployer(self, **kwargs)
326
326
  deployer.deploy()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syd
3
- Version: 1.2.3
3
+ Version: 1.2.5
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>
@@ -233,6 +233,7 @@ black . # from the root directory of the repo
233
233
  ```
234
234
 
235
235
  ## To-Do List
236
+ This section doubles as a checklist for things I think could be useful and _a place to get feedback about what users think is useful_. If you think something in this is critical and should be prioritized, or if you think something is missing, please let me know by submitting an issue on the [github issues page](https://github.com/landoskape/syd/issues).
236
237
  - Layout controls
237
238
  - [ ] Add a "save" button that saves the current state of the viewer to a json file
238
239
  - [ ] Add a "load" button that loads the viewer state from a json file
@@ -1,15 +1,15 @@
1
- syd/__init__.py,sha256=F9xhgvOaysdyubOmYiL698xHAJAEfmXPb6mLNpaZC2c,117
1
+ syd/__init__.py,sha256=vegsqm4zQ_sfa0BFitwk_n8yT_Fka5mN7gs_0yrMNPs,117
2
2
  syd/parameters.py,sha256=lzCHSMGYEdQ_FMbcXnntdPF1XvCm7fybB6CNy3TFn04,43543
3
3
  syd/support.py,sha256=LoHOsTN0byyDxk9uibjM0BKnI-vAJ4aU-tWILMCXz1Y,6783
4
- syd/viewer.py,sha256=d1-uca7WPEoH8InDUg1osK5uQU6RQ0QXydwS_81EME0,52681
4
+ syd/viewer.py,sha256=yKycDAFfyKu8WEp-VUtHVG1Ad4flQtQ3bHqPaQ4JWVM,52699
5
5
  syd/flask_deployment/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
6
- syd/flask_deployment/deployer.py,sha256=GruWJ3pA6NI8tmMavQo4Sl8_jvZbFi1k8LGPPd2JkmU,29554
6
+ syd/flask_deployment/deployer.py,sha256=TKlf4jtRN4t67cuHypcVZe2c8-P3zkXovO5EpXKW2LQ,29827
7
7
  syd/flask_deployment/testing_principles.md,sha256=GyULM97sDeie8h3tSPoduOckdMNGyWuwm1RdHo5jzK0,10130
8
8
  syd/flask_deployment/static/__init__.py,sha256=ieWE8NKR-APw7h4Ge0ooZGk6wZrneSSs_1cMyTPbQSA,65
9
9
  syd/flask_deployment/static/css/styles.css,sha256=GQgIPbWMdfTgU-HN80FCObA8bd1FPiwa1Dq0yRANsPc,5944
10
10
  syd/flask_deployment/static/css/viewer.css,sha256=rViWJ4w6vahuOr0RIpowgJfg7HN4TzMAuYrQmqhi1V0,805
11
11
  syd/flask_deployment/static/js/old_viewer.js,sha256=aIh0gxrwMWUYVge4taj0pucg2RiCcWVuV9ekBvUVsPU,40594
12
- syd/flask_deployment/static/js/viewer.js,sha256=D-I0hUZQPMSIgB9b8taWNVIsBBUeK1VpLjWI1KtOgSo,2672
12
+ syd/flask_deployment/static/js/viewer.js,sha256=QVDPMl-WtM3vHKO6KCiVCp005CiAakT5tWoaVDso6M0,2462
13
13
  syd/flask_deployment/static/js/modules/api.js,sha256=4qZW9DKH-IqslOKj4ypV5Vju9wr9Qfhckf7BQGk1KqM,3117
14
14
  syd/flask_deployment/static/js/modules/config.js,sha256=XxvyNhOUoyXXcacmhNzawKZiy9Q473sY98y7WipofLs,850
15
15
  syd/flask_deployment/static/js/modules/plot.js,sha256=dHZAaw_hjrrMa1IGet8HhYJvB0Ze3KoFjmB6duuhFhg,2622
@@ -18,11 +18,11 @@ syd/flask_deployment/static/js/modules/system_controls.js,sha256=7HYd8meNWEgp_xf
18
18
  syd/flask_deployment/static/js/modules/ui_controls.js,sha256=Z7n1TPvx25Xtw-cVKhIsEV72TBIrdUmdG6yVhjFQ5Rw,30038
19
19
  syd/flask_deployment/static/js/modules/utils.js,sha256=xqIBRvTrZCnm65xZ9R6mqeHFni4h0Q2x3G6gtQ9AWw8,1420
20
20
  syd/flask_deployment/templates/__init__.py,sha256=ieWE8NKR-APw7h4Ge0ooZGk6wZrneSSs_1cMyTPbQSA,65
21
- syd/flask_deployment/templates/index.html,sha256=OmGaEdEPZ_ALPq7ZHk47jw-ZX9pOUUk57M3gXT0V1Lk,1608
21
+ syd/flask_deployment/templates/index.html,sha256=KDMR-KTMpdQa1PS8py71-NSoGMAWE3qwDz6juXk8oXI,1565
22
22
  syd/notebook_deployment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  syd/notebook_deployment/deployer.py,sha256=ovuFvj5_qXB5WToNhCxrEHmPuKYypIeLqrUg0KjovQs,12706
24
24
  syd/notebook_deployment/widgets.py,sha256=ptys7exVA6NCF4eCRZMTPJblT0ZbtPdN4o2A0Yh5Cfc,20781
25
- syd-1.2.3.dist-info/METADATA,sha256=__2yUadLeltLH-FVG6A9BMQlMrf8PoY3R15iDe6ViCU,14984
26
- syd-1.2.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- syd-1.2.3.dist-info/licenses/LICENSE,sha256=YF6QR6Vjxcg5b_sYIyqkME7FZYau5TfEUGTG-0JeRK0,35129
28
- syd-1.2.3.dist-info/RECORD,,
25
+ syd-1.2.5.dist-info/METADATA,sha256=U4bMgpT10LCsQyI476ZO0l8PciUnOiOfdq2UEDzFyYo,15340
26
+ syd-1.2.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ syd-1.2.5.dist-info/licenses/LICENSE,sha256=YF6QR6Vjxcg5b_sYIyqkME7FZYau5TfEUGTG-0JeRK0,35129
28
+ syd-1.2.5.dist-info/RECORD,,
File without changes