Skip to content

Commit

Permalink
more default channels, fixed README.rst link for pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
ioneater committed Nov 6, 2023
1 parent d262c4f commit 0b22868
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A comprehensive data acquisition and analysis tool for Electrospray Ion-Beam Dep
:target: https://badge.fury.io/py/esibd-explorer
:alt: ESIBD Explorer on PyPI

.. figure:: https://github.com/ioneater/ESIBD-Explorer/blob/main/docs/pages/2023-10_ESIBD_GUI_plain.png
.. figure:: https://github.com/ioneater/ESIBD-Explorer/blob/main/docs/pages/2023-10_ESIBD_GUI_plain.png?raw=true

**ESIBD Explorer user interface.** The ESIBD Explorer controls all aspects of an Electrospray Ion-Beam Deposition (ESIBD) experiment,
including optimization and characterization of the ion-beam energy, beam intensity, and beam size, as well as monitoring of the deposition.
Expand Down
5 changes: 3 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ twine upload -r testpypi dist/*
REM conda create -n "estest" python=3.11
REM conda activate estest
REM pip install -i https://test.pypi.org/simple/ esibd-explorer
REM pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ esibd-explorer==0.6.11 # use pypi dependencies that are not present on testpypi
REM pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ esibd-explorer==0.6.12 # use pypi dependencies that are not present on testpypi

REM only upload on real pypi after testing!
REM twine upload dist/*
Expand All @@ -66,9 +66,10 @@ REM pyinstaller
:::::::::::::::

call rmdir /q /s build
call rmdir /q /s pyinstaller_dist
conda create -n "esibdtest" python=3.11
conda activate esibdtest
pip install -i https://pypi.org/simple/ esibd-explorer
pip install esibd-explorer --upgrade
pip install pyinstaller

REM Run the following line to create initial spec file
Expand Down
7 changes: 1 addition & 6 deletions esibd/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ def loading(self, loading):
self._loading +=1
else:
self._loading -= 1
# print('pluginManager', self._loading)

def loadPlugins(self, reload=False):
"""Loads all enabled plugins."""
Expand Down Expand Up @@ -1551,7 +1550,7 @@ def initGUI(self, item):
self.getParameterByName(name).value = item[name]
else:
self.getParameterByName(name).value = default[self.VALUE]
if not name in self.tempParameters() and not item == {}: # item == {} -> generating default file
if not name in self.tempParameters() and not len(item) < 2: # len(item) < 2 -> generating default file
self.print(f'Added missing parameter {name} to channel {self.name} using default value {default[self.VALUE]}.')

line = self.getParameterByName(self.EQUATION).line
Expand Down Expand Up @@ -1690,7 +1689,6 @@ class FloatValidator(QValidator):

def valid_float_string(self, string):
match = self._float_re.search(string)
# print(string, match.groups()[0], match.groups()[0] == string, match)
return match.groups()[0] == string if match else False

def validate(self, string, position): # -> typing.Tuple[State, str, int]:
Expand Down Expand Up @@ -1939,7 +1937,6 @@ def __init__(self, plugin):

def toggleTitleBar(self):
"""Updates titlebar as dock is changing from floating to docked states."""
# print('toggleTitleBar', self.plugin.name, self.isFloating())
if self.isFloating(): # dock is floating on its own
# self.setWindowFlags(Qt.WindowType.Window)
if self.plugin.titleBarLabel is not None:
Expand Down Expand Up @@ -2476,7 +2473,6 @@ def __init__(self, parent=None, background='default', plotItem=None, **kargs):
def mouseMoveEvent(self, ev):
pos = QPointF(ev.pos())
if self.getPlotItem().getViewBox().geometry().contains(pos): # add offset
# print(ev.pos(), self.getPlotItem().getViewBox().mapSceneToView(pos))
pos = self.getPlotItem().getViewBox().mapSceneToView(pos)
try:
if self.getPlotItem().ctrl.logYCheck.isChecked():
Expand Down Expand Up @@ -2506,7 +2502,6 @@ class SciAxisItem(pg.AxisItem):

def logTickStrings(self, values, scale, spacing):
estrings = [f'{x:.0e}' for x in 10 ** np.array(values).astype(float) * np.array(scale)]
# print(estrings, values, scale)
convdict = {"0": "⁰",
"1": "¹",
"2": "²",
Expand Down
8 changes: 2 additions & 6 deletions esibd/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def loading(self, loading):
self._loading +=1
else:
self._loading -= 1
# print(self.name, self._loading)

def test(self):
"""Runs :meth:`~esibd.plugins.Plugin.runTestParallel` in parallel thread."""
Expand Down Expand Up @@ -1049,7 +1048,6 @@ def updateLivePlot(self):
return
# otherwise toogle visibility is sufficient
for channel in self.device.channels:
# print(channel.name, channel.display)
if channel.display:
channel.plotCurve.setPen(pg.mkPen(QColor(channel.color), width=int(channel.linewidth)))
channel.plotCurve.opts['name'] = channel.name
Expand Down Expand Up @@ -1475,7 +1473,8 @@ def loadConfiguration(self, file=None, default=False):
else: # Generate default settings file if file was not found.
# To update files with new parameters, simply delete the old file and the new one will be generated.
self.print(f'Generating default config file {file}')
self.addChannel(item={})
for i in range(9):
self.addChannel(item={Parameter.NAME : f'{self.name}{i+1}'})
self.exportConfiguration(file, default=True)
else: # file.suffix == EsibdCore.FILE_H5:
with h5py.File(name=file, mode='r', track_order=True) as f:
Expand Down Expand Up @@ -1827,7 +1826,6 @@ def updateValues(self, N=2, apply=False):
if self.updating or self.pluginManager.closing:
return
self.updating = True # prevent recursive call caused by changing values from here
# print(self.name,'updateValues rand:', np.random.rand())
channels = self.pluginManager.DeviceManager.channels(inout=INOUT.IN) if self.inout == INOUT.IN else self.pluginManager.DeviceManager.channels(inout=INOUT.BOTH)
for _ in range(N): # go through parsing N times, in case the dependencies are not ordered
for channel in [c for c in self.channels if not c.active and c.equation != '']: # ignore if no equation defined
Expand Down Expand Up @@ -3702,13 +3700,11 @@ def stop(self):
self.recording = False
for d in self.getDevices():
d.stop()
print(f'stopped {d.name}')
self.stopScans()

def stopScans(self):
for s in self.pluginManager.getPluginsByType(PluginManager.TYPE.SCAN):
s.recording = False # stop all running scans
print(f'stopped {s.name}')

def exportOutputData(self, file=None):
self.pluginManager.Settings.measurementNumber += 1
Expand Down
4 changes: 0 additions & 4 deletions esibd/plugins_internal/displays/Displays.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,9 @@ def downsample(self, ax):
xdata = self.origXData[mask]
ydata = self.origYData[mask]
cutoff = abs(0.0001*(ymax-ymin))
# print('xdata before ', len(xdata),'cutoff: ', cutoff)
while [abs(ydata[i] - ydata[i-1]) > cutoff for i in range(len(ydata))].count(True) > self.max_points:
cutoff *= 4
# print([abs(ydata[i] - ydata[i-1]) > cutoff for i, v in enumerate(ydata)].count(True), self.max_points, cutoff)
mask = [abs(ydata[i] - ydata[i-1]) > cutoff for i in range(len(ydata))]
# print('xdata cleaned ', len(xdata[mask]),'cutoff', cutoff)
return xdata[mask], ydata[mask]

def update(self, ax):
Expand Down Expand Up @@ -420,7 +417,6 @@ def loadData(self, file, _show=True):
self.raiseDock(_show)

def mapSliderToData(self, slider, data):
# print(slider.value(), data.min(), data.max(), data.min() + slider.value()/100*(data.max() - data.min()))
return data.min() + slider.value()/100*(data.max() - data.min())

def drawSurface(self, angle=True):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "esibd-explorer" # package name can include hyphens, module names should be lower case without hyphens.
requires-python = ">=3.11"
version = "0.6.12"
version = "0.6.14"
description = "A comprehensive data acquisition and analysis tool for Electrospray Ion-Beam Deposition experiments and beyond."
license = {file = "LICENSE"}
readme = "README.rst"
Expand Down

0 comments on commit 0b22868

Please sign in to comment.