Commit graph

696 commits

Author SHA1 Message Date
Richard
a8b1efb7cd Removed openapi endpoints (now in LabThings) 2021-07-25 01:23:44 +01:00
Richard
7b54abc210 blackened 2021-07-19 22:22:58 +01:00
Richard
34af06b1d1 Document route parameter in nested dictionaries 2021-07-19 22:21:39 +01:00
Richard
ec992c083f Describe filename param in capture download 2021-07-19 21:40:28 +01:00
Richard
36be07b276 Responses and parameters for zipbuilder 2021-07-19 21:32:08 +01:00
Richard
ba0f78df84 fix typing in autofocus
I have an Optional dz, which is then
populated with a default if it's None.
I've added an explicit cast() to explain this to mypy.
2021-07-19 21:18:25 +01:00
Richard
72f3c11fdd linting and typing fixes 2021-07-19 20:29:13 +01:00
Richard
b7c9d3b73b Sorted remaining content_type issues and blackened 2021-07-19 20:09:09 +01:00
Richard
38fbe530d2 Fix externalDocs entries
My externalDocs entries in the "tags" metadata section
of the OpenAPI description were not valid.
This is now fixed.
2021-07-19 11:56:40 +01:00
Richard
077d6fdc4b Added OpenAPI validation from apispec 2021-07-19 11:50:50 +01:00
Richard
6a7c305468 Started adding more content to openapi 2021-07-14 19:15:26 +01:00
Richard
48fa1842a9 Fixed stage schemas
If missing=None, we need to specify allow_None=False
in order to generate valid OpenAPI.
This may also be fixed by an upstream change in LabThings.

Also, OneOf was being used incorrectly in StageTypeProperty.
2021-07-13 22:53:35 +01:00
Richard
50ad9d4369 Fixed content dicts to be valid OpenAPI
For functions that return JPEGs, we were
 using "content_type": "image/jpeg"
 instead we should use "content": { "image/jpeg": {}}
2021-07-13 22:52:10 +01:00
Richard
9892c7079a moved find_microscope into functions 2021-07-13 22:50:42 +01:00
Richard
00531a93bf Fixed response descriptions for stream/RAM capture 2021-07-06 15:24:43 +01:00
Richard
c81c4eb64d Better API docs for autofocus extension 2021-07-06 15:24:17 +01:00
Richard
202d942c90 Add entry point to generate OpenAPI yaml/json
This is designed to be used as a console entry point so we can generate
the OpenAPI description without starting the server.
2021-07-06 15:23:42 +01:00
Richard
8157fa6d58 Add YAML export from APISpec 2021-06-27 21:08:48 +01:00
Richard
3921f5de76 Remove commented-out code 2021-06-22 10:57:48 +01:00
Richard
03cb019864 Don't remember the "scanCapture" setting
Given that it changes the "capture" button from
single image acquisition to a long running scan,
I think it's less confusing if the "scan capture" setting
is not remembered across page refreshes.
2021-06-03 16:21:03 +01:00
Richard
318c4088dd Auto-open scan section if enabled
Saving default to local storage has a problem:
if you have ticked "scan", the section is not
visible by default so it's easy to start a scan
by accident.  I've now forced it to be open if
the scanCapture checkbox is true.
2021-06-03 16:16:00 +01:00
Richard
31faaaf161 Whitespace linting fixes 2021-06-03 16:10:03 +01:00
Richard
178d6fb84b Fix ame of CaptureContent 2021-06-03 16:09:51 +01:00
Richard
8afa503867 Scan settings are now remembered
This is done in local storage, and I'm
quite pleased with how neat it is!
Happy to be corrected on a better way to pass `this` though!
2021-06-03 16:09:40 +01:00
Richard Bowman
de28b0e2f6 Merge branch 'improve-local-development' into 'master'
Local development improvements

See merge request openflexure/openflexure-microscope-server!125
2021-05-18 10:56:10 +00:00
Richard Bowman
4d405443bb Merge branch 'scan-shape-limits' into 'master'
Add minimum scan dimension

See merge request openflexure/openflexure-microscope-server!123
2021-05-18 10:55:06 +00:00
Richard
f2a4b976b9 Fix whitespace 2021-05-13 10:43:50 +01:00
Richard
126766aa06 Removed unnecessary package
I'm not using vuex-map-fields, so have
removed it.
2021-05-05 16:44:25 +01:00
Richard
0bdb5b4721 Actually save stream settings to local storage
After some refactoring, I lost the code that actually
saved stream settings to local storage.
This commit restores that functionality.
2021-05-05 16:19:43 +01:00
Richard
0c6e6caade Improve errors with better exception
I've swapped the ValueError for a RuntimeError subclass to
make it clearer what's gone wrong.
2021-05-05 10:05:47 +01:00
Richard Bowman
14c4908a98 fix linter error 2021-05-04 13:41:39 +01:00
Richard Bowman
6e7adb66cd Fix handling of missing CSM matrix
The code checks for the camera-stage mapper matrix by looking at its truth value.
However, this is ambiguous because the matrix has many elements.  That means that
if it's missing, we get the expected result, but if it's present
we get an error.

I have avoided dict.get() and instead look it up with [] notation.
This will raise a KeyError if it's missing, which I
handle helpfully.
If the key is present but the value is not castable to an array, we'll
get an exception anyway.
2021-04-28 22:29:56 +01:00
Richard Bowman
82eba1e99a fixed typing error 2021-04-27 20:17:07 +01:00
Richard Bowman
87f636ecc0 Code format and linting 2021-04-27 19:56:54 +01:00
Richard Bowman
bb303d4766 Simplified auto gain/exposure algorithm
adjust_shutter_and_gain_from_raw now uses a simpler algorithm.
The code is longer overall but hides some details in fuctions.
I've also split the loop into one for shutter speed and one for gain.
This isn't the algorithm that I originally wrote, but it seems to
work and is more readable.
2021-04-27 18:54:21 +01:00
Richard Bowman
42f00b69a4 Merge remote-tracking branch 'origin/master' into auto-exposure-gain-awb
This was primarily done to disable the warning about f strings in
logging statements, globally rather than per-file.
2021-04-27 17:16:19 +01:00
Richard Bowman
79b0d48cf4 Swap Generator annotation for Iterator 2021-04-27 17:13:40 +01:00
Richard
82a277b04c Cache stream settings in local storage
GPU preview and MJPEG stream settings are now persisted
using localStorage.  The old code that disabled
the stream for local connections now
just sets the initial/default value.

The initialisation of stream settings is now done
in the created() method of streamContent.vue.

I've eliminated the "globalsafetogglepreview" event
in favour of watching the store.
2021-04-27 16:36:55 +01:00
Richard
e14800b549 linter fixes 2021-04-27 14:28:08 +01:00
Richard Bowman
a2ba95c1d3 Minor linting improvements
I have now disabled W1203 globally, see comment in
pyproject.toml
2021-04-27 11:17:11 +01:00
Richard Bowman
90f5a755b1 Handle absolute moves correctly
I've changed the default values in MoveStageAPI
so that it correctly handles absolute moves with missing axes.
I've also simplified it so it isn't using axes_to_array as that
resulted in a confusing code path.
2021-04-27 10:55:51 +01:00
Richard Bowman
88de3089ea Fixed linter errors 2021-04-21 13:38:14 +01:00
Richard Bowman
8c50f73b34 Fixed type of context manager 2021-04-21 12:54:53 +01:00
Richard Bowman
fd32c22e30 Fixed formatting 2021-04-21 12:40:10 +01:00
Richard Bowman
1f1a75c02a Merge branch 'master' into auto-exposure-gain-awb 2021-04-21 12:10:47 +01:00
Richard Bowman
e86e4d983a Merge branch 'abandon-poetry' into 'master'
Move away from poetry

Closes #218

See merge request openflexure/openflexure-microscope-server!124
2021-04-21 10:57:28 +00:00
Richard Bowman
1cea75be70 Formatting fixes 2021-03-31 09:40:31 +01:00
Richard Bowman
e73ee8875c Fixed type annotations in autofocus and mock stage
I don't know why these didn't fail before - possibly because of
incomplete type information from old numpy...
I removed a few annotations because they were failing (e.g.
np.sum can return a scalar or an array), but I don't think
this should be a problem - the function inputs and return values
are still typed.
2021-03-30 17:51:00 +01:00
Richard Bowman
cd5e32b843 Removed deprecated np.float
numpy 1.20 deprecates np.float, which was only ever an alias for
``float``.  I've replaced all occurrences of np.float with float, as
recommended.  There should be no change in functionality.
2021-03-30 17:40:19 +01:00
Kaspar Emanuel
97bbbdee84 Merge branch 'ihi_scan' into 'master'
IHI scan style raster

See merge request openflexure/openflexure-microscope-server!113
2021-03-30 12:29:32 +00:00