Commit graph

2542 commits

Author SHA1 Message Date
Richard Bowman
a9fff24848 Explicitly specify encoding
The update to pylint means we were failing because open()
doesn't specify the encoding everywhere.  I have now specified utf-8
everywhere.  This was patchy before, and is default behaviour on the
Pi.  There's a slim chance it will cause some issues on Windows, but
that shouldn't affect anyone outside the developers.

I've also ignored a couple of new spurious warnings, and explicitly
ignored some unused variables.
2022-08-09 07:16:44 +01:00
Richard Bowman
9b7fba55b6 Update CI script to new syntax 2022-08-08 22:22:55 +01:00
Richard Bowman
3aa2721d28 Update changelog (version is already 2.11.0) 2022-08-08 22:19:30 +01:00
Richard Bowman
d98cc3ff34 Update sangaboard dependency and re-lock
Dependencies could use some revision - in particular could we use
Flask 2?  That's a LabThings issue really...

I have updated a few dependencies (mostly dev ones), as ever Black is
an issue - have reverted to the previous pinned prerelease because the
full release is incompatible with flask 2.
2022-08-08 22:08:20 +01:00
Richard Bowman
ed6e22d020 Bump version and add sangaboard v4 dependency 2022-08-04 17:08:34 +01:00
Richard Bowman
3d164936cb Merge branch 'background-detection-for-scans' into 'master'
Background detect and better focus handling in tiled scans

See merge request openflexure/openflexure-microscope-server!153
2022-05-05 16:12:49 +00:00
Richard Bowman
e356d11e7e Linter/type checking fixes 2022-04-20 13:31:33 +01:00
Richard Bowman
18145d4b67 Refactored new (and some old) code to tidy up scan function
I have:
* Moved the autofocus and focus-prediction code into a
new `FocusManager` class.  This hopefully keeps the logic relating to
axial motion in one place.
* Moved set-up code relating to autofocus and background detection
into separate functions.
* Changed the scan path from a ragged list-of-lists to a one dimensional
list.  I've left the old 2D function and added a new 1D function that
calls it and coverts, so it's not a breaking change.

The actual sequence of moves executed, and the accompanying logic, is
unchanged from the previous commit.  I've tested this a couple of times,
on my microscope with actual hardware.
I don't think it's necessary to test more widely as this is only a
refactoring change, not an algorithm change.

The shift from 2D to 1D scan path was one I initially decided against,
because I was trying to keep the new code as small as possible, and
avoid refactoring what's already there.  Since I'm doing that anyway,
I have taken the opportunity to eliminate the concept of scan
"lines".

The old behaviour was to always use the position of the last point
as the starting point for the next autofocus.  There was an exception
to this for raster scans, where the big jump used the first point
of the last line instead.  The new behaviour always uses the closest
point, which reproduces this behaviour without the need for a hard
coded exception.

If the "fast" scan axis (y) has a longer step size than the "slow"
scan axis (x), we may base the autofocus off the previous row, rather
than the previous point in the current row.  I don't see that this
should be any less reliable than the current behaviour, and is
arguably better.  It's also unlikely to be noticed, because our
default scan settings have longer spacing in X.  I think the
reduced complexity of the code is definitely worth the small
chance of changing some edge-case behaviour.
2022-04-20 13:14:23 +01:00
Richard Bowman
7f66235cac Lint and type fixes 2022-04-06 23:36:55 +01:00
Richard Bowman
cfb1bb09a6 Added scan control for background detect
There is now a button that appears when the background-detect
extension is installed, allowing you to skip autofocus if the
field looks like background.
2022-04-06 23:17:10 +01:00
Richard Bowman
333b52aa9b background detect and better focus handling
The primary change here is that there's now an option
to skip autofocus if the background detect plugin says
the current image is background.

I have also overhauled the way it picks the next Z position
based on Joe's code; instead of just using the last point, it will
pick the closest point where we have a successful autofocus
recorded.  This will usually be the last point, except for raster
scans where it neatly reproduces the behaviour of the old code
but without needing to treat it as a special case (when we jump
back to the start of a line, it will use the z position of the start
of the previous line, rather than the end of the previous line).

This does represent a minor change to previous behaviour, but
it should not break anything that isn't already broken, i.e. it might
cause slightly odd behaviour if autofocus gives random results -
but probably indistinguishable from the current behaviour.
2022-04-06 23:15:25 +01:00
Julian Stirling
fe3af0fd29 Merge branch 'version-bump-and-changelog' into 'master'
Version bump and changelog

See merge request openflexure/openflexure-microscope-server!152
2022-01-17 12:23:52 +00:00
Richard Bowman
ecc861a06e Merge branch 'glyg-master-patch-10249' into 'master'
Fix small typo, fixes #243

Closes #243

See merge request openflexure/openflexure-microscope-server!148
2022-01-17 11:45:34 +00:00
Richard Bowman
164cf43277 Merge branch 'settling_times' into 'master'
Added measure_settling_time function to autofocus

See merge request openflexure/openflexure-microscope-server!149
2022-01-17 11:45:31 +00:00
Richard Bowman
6d1366db61 Version bump and changelog 2022-01-17 11:39:04 +00:00
Richard Bowman
ff1ee54ca7 Merge branch 'less-verbose-captures' into 'master'
Bump some logging statements to DEBUG

See merge request openflexure/openflexure-microscope-server!151
2022-01-13 16:51:53 +00:00
Richard Bowman
1339c23757 Bump some logging statements to DEBUG
Any action that takes captures ends up with
a log that's full of capture write operations,
because each new capture generates 6-10
messages.

I'm moving said messages to DEBUG because I
don't think they are important any more, and
they do clutter up the log.
2022-01-13 14:56:18 +00:00
Richard Bowman
23bf3410f3 Code formatting fixes from black 2022-01-13 14:47:38 +00:00
Joe Knapper
2d494b41d9 Added docstring for measure_settling_time and hold 2022-01-11 15:46:15 +00:00
Joe Knapper
ecbdd8a5bf Added measure_settling_time function to autofocus 2021-12-01 13:09:32 +00:00
Guillaume Gay
046c28db97 Fix small typo, fixes #243 2021-11-26 11:07:59 +00:00
Richard Bowman
315ee0950b Merge branch 'zenodo-upload' into 'master'
Added automatic upload of tags to Zenodo.

See merge request openflexure/openflexure-microscope-server!146
2021-09-28 10:21:33 +00:00
Richard
e26331f2ba Disable sandbox - it works! 2021-09-28 10:56:53 +01:00
Richard
c19ff84344 Fix CI configuration 2021-09-28 10:24:02 +01:00
Richard
a0788ac333 Added automatic upload of tags to Zenodo.
Co-authored-by: Kaspar Emanuel <kaspar@monostable.co.uk>
2021-09-28 10:20:39 +01:00
Richard Bowman
8bd661a066 Merge branch 'release-prep' into 'master'
Release prep

See merge request openflexure/openflexure-microscope-server!145
2021-09-27 13:55:22 +00:00
Richard
e5ba12aab1 Version bump 2021-09-22 00:15:14 +01:00
Richard
dc3801d444 Wrote a changelog for the latest release 2021-09-22 00:14:40 +01:00
Richard
47cc594a3b Mention the user guide in README 2021-09-22 00:03:40 +01:00
Kaspar Emanuel
4048b62674 Merge branch 'fix-readthedocs' into 'master'
Documentation improvements

See merge request openflexure/openflexure-microscope-server!140
2021-09-21 17:48:23 +00:00
Richard
67b57727f6 Format fixes 2021-09-21 17:45:17 +01:00
Richard
3971a92a5f Install more dependencies
This commit fixes a couple of errors in the Sphinx docs, by
removing mock imports and replacing them with real ones.
2021-09-21 17:38:15 +01:00
Richard
f0fcd53487 Update link to openapi documentation 2021-09-21 15:41:29 +01:00
Richard
ebf8376bd4 Formatting fixes 2021-09-21 14:48:41 +01:00
Richard
72c060c213 Workaround for LFS images
There is now code in `conf.py` to install git LFS and to check images
are correctly fetched.
2021-09-21 14:22:22 +01:00
Richard
107ef80b9e Track documentation images with LFS
PNG images in the docs/ directory will be tracked using LFS, to
avoid the repo becoming unmanageable.
2021-09-21 14:04:08 +01:00
Richard
151d9f1bc0 Various fixes to docs
I've added a lot more mock imports so the automatic documentation now works.

I've updated the links between pages (removing .rst extension) so they work.

I've added a link to the settings pane image.
2021-09-21 14:04:08 +01:00
Richard
a09d2411a0 Add documentation of the web app
A first pass of documentation describing the web app GUI.  Screenshots
are committed as LFS objects, I've been deliberately conservative here
(only png files in the docs/ directory are LFSed) to avoid messing
with any static files in the web app.
2021-09-21 14:04:08 +01:00
Richard
3b40ae9918 Don't build OpenAPI automatically
Readthedocs won't be able to build OpenAPI, so I've removed this from
the makefile.
2021-09-21 14:04:08 +01:00
Richard Bowman
1cd097b7aa First attempt at fixing readthedocs
This removes the API documentation - we will render it separately.
2021-09-21 14:04:08 +01:00
Richard Bowman
a611d4f5ce Deploy OpenAPI description properly 2021-09-21 14:04:08 +01:00
Richard Bowman
a2de316e31 Merge branch 'update-js-dependencies' into 'master'
Run `npm audit fix`

See merge request openflexure/openflexure-microscope-server!141
2021-09-16 16:28:16 +00:00
Kaspar Emanuel
9cc26b8060 Merge branch 'hide-smart-stack-controls' into 'master'
Hide smart stack controls when they are not required

See merge request openflexure/openflexure-microscope-server!142
2021-09-16 15:17:42 +00:00
Richard
bb4b7335a3 Hide smart stack controls when they are not required
The code that checked for the presence of the smart stack plugin had a typo,
and would display smart stack controls whenever the stack and scan extension
was detected (whether or not the smart stack extension was enabled).

This is now fixed.
2021-09-16 15:47:11 +01:00
Kaspar Emanuel
f5c01c612b Run npm audit fix 2021-09-16 15:45:12 +01:00
Kaspar Emanuel
0e628e0d53 Merge branch 'move-js' into 'master'
Move Vue app to a "webapp" directory

See merge request openflexure/openflexure-microscope-server!122
2021-09-16 14:37:00 +00:00
Kaspar Emanuel
b2eb1e0f05 Rename js directory to webapp 2021-09-16 15:13:19 +01:00
Richard
375bcf4e73 fix typo in artifact path 2021-09-16 15:13:19 +01:00
Richard
a42e94ce66 Fix JS build artifact
The JS build step was reporting the JS source folder as an artifact.
I've updated it to use the output folder instead.
2021-09-16 15:13:19 +01:00
Kaspar Emanuel
c835bf3b7e Update readme with new js directory 2021-09-16 15:13:18 +01:00