Commit graph

2476 commits

Author SHA1 Message Date
Richard Bowman
3e02fe4790 Merge branch 'static-docs' into 'master'
Improved API docs

See merge request openflexure/openflexure-microscope-server!133
2021-08-17 11:33:40 +00:00
Richard Bowman
7860b6eda7 deleted some commented-out extensions 2021-08-17 12:18:10 +01:00
Richard Bowman
040d7d4ba6 Fix action wrapper
The action wrapper was using an unbound function - it
now passes the extension object as self.

We were incorrectly passing endpoint names as positional arguments -
this is fixed and I now use a keyword argument.
2021-08-17 12:11:20 +01:00
Kaspar Emanuel
6d25dcfa9e Merge branch 'smart-stack-controls' into 'master'
Added controls for smart stack

See merge request openflexure/openflexure-microscope-server!134
2021-08-17 09:43:32 +00:00
Richard
d7d7a8cc8d Blackened test_app.py 2021-08-09 22:01:14 +01:00
Richard
b7c15886e9 Use neater spread operator to copy objects
Rather than Object.assign, I now use the ... operator to
ensure that dictionaries don't pollute each other in computed
properties.
2021-08-09 21:57:52 +01:00
Richard
332ecad19b Update caniuse-lite 2021-08-02 10:31:07 +01:00
Richard
c831937b05 Validate thing description in tests 2021-07-26 02:48:45 +01:00
Richard
5e36837e5f Blackened tests 2021-07-25 22:59:59 +01:00
Richard
89f350cf7e Create docs/build directory in CI 2021-07-25 22:56:47 +01:00
Richard
80cebe3ebc Add test for valid OpenAPI 2021-07-25 22:26:52 +01:00
Richard
fe3fb5c66b Incorporate LabThings 1.3
The necessary changes to produce valid OpenAPI docs are now in
the latest release of LabThings.  This change updates it.

Also, isort was trying to sort my virtual environment, hence
the change to pyproject.toml.
I don't know why that happened - maybe an update to isort?
2021-07-25 22:23:54 +01:00
Richard
3cdfd52a77 Added controls for smart stack 2021-07-25 09:14:33 +01:00
Richard
1d16792681 Removing unnecessary validation code
I wrote test_swagger_yaml before I realised I could
validate the API with apispec directly.
2021-07-25 03:45:16 +01:00
Richard
b6228ba2d5 Removed unnecessary node junk
I'd briefly installed some node utilities in docs/
These are not needed, so I'm removing the associated .gitignore
2021-07-25 03:44:26 +01:00
Richard
cfba9d5c09 downgrade pylint
pylint 2.9 seems to die on this code, no idea why. It's a crash in
pylint rather than an error in the code I think.
2021-07-25 03:41:06 +01:00
Richard
9fa545f3fa Typing fix
mypy doesn't like adding attributes to functions, so
I have used the described_operation decorator to
add type hints to the functions.
2021-07-25 03:38:20 +01:00
Richard
a8b1efb7cd Removed openapi endpoints (now in LabThings) 2021-07-25 01:23:44 +01:00
Richard Bowman
e2990b5b38 Bump pylint version and fix to 2.8 to avoid bug
pylint 2.9 crashes - I can't figure out why, but it seems like it's
a bug in pylint rather than an error in our code.
We should try to track it down and get it fixed, I've seen
some similar bug reports on their github, but
all of them should be resolved in 2.9...
2021-07-21 10:49:56 +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 Bowman
8eba9d7981 Build and validate OpenAPI YAML description in CI 2021-07-19 10:51:42 +00: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
8422e8bfef ignore local installation of swagger-cli 2021-07-13 22:54:11 +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
65f5a69bad fix openapi response in docs 2021-07-13 22:49:06 +01:00
Richard
19abfff061 Add HTTP API to docs 2021-07-06 15:26:27 +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
1e21ce51fc Some basic validation for OpenAPI
I was getting unhelpful OpenAPI errors, this Python script makes it easier
to figure out where they come from.
2021-07-06 15:18:53 +01:00
Richard Bowman
5b63745ad0 Merge branch 'imjoy-support' into 'master'
Added imjoy support

Closes #157

See merge request openflexure/openflexure-microscope-server!120
2021-06-29 12:08:52 +00:00
Richard
8157fa6d58 Add YAML export from APISpec 2021-06-27 21:08:48 +01:00
Richard Bowman
5279becce7 Merge branch 'remember-scan-parameters' into 'master'
Scan settings are now remembered

Closes #216

See merge request openflexure/openflexure-microscope-server!132
2021-06-22 11:21:20 +00:00
Richard
f5711d953d linter fixes 2021-06-22 12:09:01 +01:00
Richard
d73b0afd36 Disable ImJoy control
If the environment variable is disabling ImJoy, don't allow
the user to enable it with the tick-box.
2021-06-22 12:08:17 +01:00
Richard
33b3ffc7f7 Rely on store to enforce IMJOY_ENABLED
This removes some now-redundant code.
2021-06-22 12:07:27 +01:00
Richard
29de95fe74 Enforce ENABLE_IMJOY variable in store
The store now won't let you enable imjoy if the environment
variable is not set to "true"
2021-06-22 12:06:48 +01:00
Richard
3921f5de76 Remove commented-out code 2021-06-22 10:57:48 +01:00
Richard Bowman
826b81f3bf Merge branch 'use-pipenv-deploy-in-ci' into 'master'
add --deploy flag to pipenv install

Closes #227

See merge request openflexure/openflexure-microscope-server!131
2021-06-22 09:55:37 +00: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