# Need to calculate gap as not passed one# We have a gap if upper[i] != lower[i+1] for any axesaxes_gap=[
- np.roll(u,1)!=l
- foru,linzip(self.upper.values(),self.lower.values())
+ np.roll(upper,1)!=lower
+ forupper,lowerinzip(self.upper.values(),self.lower.values())]self.gap=np.logical_or.reduce(axes_gap)# Check all axes and ordering are the same
@@ -754,11 +739,11 @@
Source code for scanspec.core
f"{list(self.midpoints)} != {list(self.lower)} != {list(self.upper)}")# Check all lengths are the same
- lengths=set(
+ lengths={len(arr)fordin(self.midpoints,self.lower,self.upper)forarrind.values()
- )
+ }lengths.add(len(self.gap))assertlen(lengths)<=1,f"Mismatching lengths {list(lengths)}"
@@ -875,10 +860,10 @@
[docs]@app.post("/valid",response_model=ValidResponse)defvalid(
- spec:Spec=Body(...,examples=[_EXAMPLE_SPEC])
+ spec:Spec=Body(...,examples=[_EXAMPLE_SPEC]),)->Union[ValidResponse,JSONResponse]:"""Validate wether a ScanSpec can produce a viable scan.
@@ -653,7 +639,7 @@
Source code for scanspec.service
request:PointsRequest=Body(...,examples=[_EXAMPLE_POINTS_REQUEST],
- )
+ ),)->MidpointsResponse:"""Generate midpoints from a scanspec.
@@ -684,7 +670,7 @@
Source code for scanspec.service
request:PointsRequest=Body(...,examples=[_EXAMPLE_POINTS_REQUEST],
- )
+ ),)->BoundsResponse:"""Generate bounds from a scanspec.
@@ -714,7 +700,7 @@
Source code for scanspec.service
spec:Spec=Body(...,examples=[_EXAMPLE_SPEC],
- )
+ ),)->GapResponse:"""Generate gaps from a scanspec.
@@ -739,7 +725,7 @@
Source code for scanspec.service
[docs]@app.post("/smalleststep",response_model=SmallestStepResponse)defsmallest_step(
- spec:Spec=Body(...,examples=[_EXAMPLE_SPEC])
+ spec:Spec=Body(...,examples=[_EXAMPLE_SPEC]),)->SmallestStepResponse:"""Calculate the smallest step in a scan, both absolutely and per-axis.
diff --git a/main/_modules/scanspec/specs.html b/main/_modules/scanspec/specs.html
index 0d0ab805..7a6d3ac3 100644
--- a/main/_modules/scanspec/specs.html
+++ b/main/_modules/scanspec/specs.html
@@ -7,7 +7,7 @@
- scanspec.specs — scanspec 0.6.5 documentation
+ scanspec.specs — scanspec 0.6.6.dev6+g11e1e20 documentation
@@ -38,7 +38,7 @@
-
+
@@ -48,7 +48,7 @@
@@ -175,13 +175,6 @@
-
-
[docs]defserialize(self)->Mapping[str,Any]:"""Serialize the spec to a dictionary."""
- returnasdict(self)
+ returnasdict(self)# type: ignore
diff --git a/main/_sources/explanations.md.txt b/main/_sources/explanations.md.txt
index 3bfd6b06..73ab289b 100644
--- a/main/_sources/explanations.md.txt
+++ b/main/_sources/explanations.md.txt
@@ -1,15 +1,10 @@
----
-orphan: true
----
-
# Explanations
Explanations of how it works and why it works that way.
```{toctree}
:maxdepth: 1
+:glob:
-explanations/technical-terms
-explanations/why-stack-frames
-explanations/why-squash-can-change-path
+explanations/*
```
diff --git a/main/_sources/explanations/decisions.md.txt b/main/_sources/explanations/decisions.md.txt
new file mode 100644
index 00000000..0533b98d
--- /dev/null
+++ b/main/_sources/explanations/decisions.md.txt
@@ -0,0 +1,12 @@
+# Architectural Decision Records
+
+Architectural decisions are made throughout a project's lifetime. As a way of keeping track of these decisions, we record these decisions in Architecture Decision Records (ADRs) listed below.
+
+```{toctree}
+:glob: true
+:maxdepth: 1
+
+decisions/*
+```
+
+For more information on ADRs see this [blog by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).
diff --git a/main/_sources/explanations/decisions/0001-record-architecture-decisions.md.txt b/main/_sources/explanations/decisions/0001-record-architecture-decisions.md.txt
new file mode 100644
index 00000000..44d234ef
--- /dev/null
+++ b/main/_sources/explanations/decisions/0001-record-architecture-decisions.md.txt
@@ -0,0 +1,18 @@
+# 1. Record architecture decisions
+
+## Status
+
+Accepted
+
+## Context
+
+We need to record the architectural decisions made on this project.
+
+## Decision
+
+We will use Architecture Decision Records, as [described by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).
+
+## Consequences
+
+See Michael Nygard's article, linked above. To create new ADRs we will copy and
+paste from existing ones.
diff --git a/main/_sources/explanations/decisions/0002-switched-to-python-copier-template.md.txt b/main/_sources/explanations/decisions/0002-switched-to-python-copier-template.md.txt
new file mode 100644
index 00000000..66fe5d8b
--- /dev/null
+++ b/main/_sources/explanations/decisions/0002-switched-to-python-copier-template.md.txt
@@ -0,0 +1,28 @@
+# 2. Adopt python-copier-template for project structure
+
+## Status
+
+Accepted
+
+## Context
+
+We should use the following [python-copier-template](https://github.com/DiamondLightSource/python-copier-template).
+The template will ensure consistency in developer
+environments and package management.
+
+## Decision
+
+We have switched to using the template.
+
+## Consequences
+
+This module will use a fixed set of tools as developed in `python-copier-template`
+and can pull from this template to update the packaging to the latest techniques.
+
+As such, the developer environment may have changed, the following could be
+different:
+
+- linting
+- formatting
+- pip venv setup
+- CI/CD
diff --git a/main/_sources/how-to.md.txt b/main/_sources/how-to.md.txt
index 8a4b3c9e..6b161417 100644
--- a/main/_sources/how-to.md.txt
+++ b/main/_sources/how-to.md.txt
@@ -1,14 +1,10 @@
----
-orphan: true
----
-
# How-to Guides
Practical step-by-step guides for the more experienced user.
```{toctree}
:maxdepth: 1
+:glob:
-how-to/iterate-a-spec
-how-to/serialize-a-spec
+how-to/*
```
diff --git a/main/_sources/how-to/contribute.md.txt b/main/_sources/how-to/contribute.md.txt
new file mode 100644
index 00000000..f9c4ca1d
--- /dev/null
+++ b/main/_sources/how-to/contribute.md.txt
@@ -0,0 +1,2 @@
+```{include} ../../.github/CONTRIBUTING.md
+```
\ No newline at end of file
diff --git a/main/_sources/how-to/run-container.md.txt b/main/_sources/how-to/run-container.md.txt
new file mode 100644
index 00000000..579c1cd0
--- /dev/null
+++ b/main/_sources/how-to/run-container.md.txt
@@ -0,0 +1,14 @@
+# Run in a container
+
+Pre-built containers with scanspec and its dependencies already
+installed are available on [Github Container Registry](https://ghcr.io/dls-controls/scanspec).
+
+## Starting the container
+
+To pull the container from github container registry and run:
+
+```
+$ docker run ghcr.io/dls-controls/scanspec:main --version
+```
+
+To get a released version, use a numbered release instead of `main`.
diff --git a/main/_sources/index.md.txt b/main/_sources/index.md.txt
index 64390f0d..a6f58e33 100644
--- a/main/_sources/index.md.txt
+++ b/main/_sources/index.md.txt
@@ -12,8 +12,7 @@ html_theme.sidebar_secondary.remove: true
How the documentation is structured
-----------------------------------
-Documentation is split into four categories, also accessible from links in the
-top bar.
+Documentation is split into [four categories](https://diataxis.fr), also accessible from links in the top bar.
diff --git a/main/_sources/reference.md.txt b/main/_sources/reference.md.txt
index 83a03333..da17b81e 100644
--- a/main/_sources/reference.md.txt
+++ b/main/_sources/reference.md.txt
@@ -4,9 +4,9 @@ Technical reference material including APIs and release notes.
```{toctree}
:maxdepth: 1
+:glob:
-reference/api
-reference/rest_api
-reference/contributing
+reference/*
genindex
+Release Notes
```
diff --git a/main/_sources/reference/api.md.txt b/main/_sources/reference/api.md.txt
new file mode 100644
index 00000000..6a6204e2
--- /dev/null
+++ b/main/_sources/reference/api.md.txt
@@ -0,0 +1,73 @@
+# API
+
+```{eval-rst}
+.. automodule:: scanspec
+
+ ``scanspec``
+ ------------
+
+```
+
+The top level scanspec module contains a number of packages that can be used
+from code:
+
+- [](#scanspec.core): Core classes like [](#Frames) and [](#Path)
+- [](#scanspec.specs): [](#Spec) and its subclasses
+- [](#scanspec.regions): [](#Region) and its subclasses
+- [](#scanspec.plot): [](#plot_spec) to visualize a scan
+- [](#scanspec.service): Defines queries and field structure in REST such as [](#MidpointsResponse)
+
+```{eval-rst}
+.. data:: scanspec.__version__
+ :type: str
+
+ Version number as calculated by https://github.com/dls-controls/versiongit
+```
+
+```{eval-rst}
+.. automodule:: scanspec.core
+ :members:
+
+ ``scanspec.core``
+ -----------------
+```
+
+```{eval-rst}
+.. automodule:: scanspec.specs
+ :members:
+
+ ``scanspec.specs``
+ ------------------
+
+ .. inheritance-diagram:: scanspec.specs
+ :top-classes: scanspec.specs.Spec
+ :parts: 1
+```
+
+```{eval-rst}
+.. automodule:: scanspec.regions
+ :members:
+
+ ``scanspec.regions``
+ --------------------
+
+ .. inheritance-diagram:: scanspec.regions
+ :top-classes: scanspec.regions.Region
+ :parts: 1
+```
+
+```{eval-rst}
+.. automodule:: scanspec.plot
+ :members:
+
+ ``scanspec.plot``
+ -----------------
+```
+
+```{eval-rst}
+.. automodule:: scanspec.service
+ :members:
+
+ ``scanspec.service``
+ --------------------
+```
diff --git a/main/_sources/reference/rest_api.md.txt b/main/_sources/reference/rest_api.md.txt
new file mode 100644
index 00000000..f54aabcb
--- /dev/null
+++ b/main/_sources/reference/rest_api.md.txt
@@ -0,0 +1,7 @@
+# REST API
+
+The endpoints of the REST service are documented below.
+
+```{eval-rst}
+.. openapi:: ../../schema.json
+```
diff --git a/main/_sources/tutorials.md.txt b/main/_sources/tutorials.md.txt
index 0f5a750c..b88db528 100644
--- a/main/_sources/tutorials.md.txt
+++ b/main/_sources/tutorials.md.txt
@@ -4,6 +4,7 @@ Tutorials for installation and typical usage. New users start here.
```{toctree}
:maxdepth: 1
+:glob:
tutorials/installation
tutorials/creating-a-spec
diff --git a/main/_sources/tutorials/installation.md.txt b/main/_sources/tutorials/installation.md.txt
index f109fb37..3e004ec0 100644
--- a/main/_sources/tutorials/installation.md.txt
+++ b/main/_sources/tutorials/installation.md.txt
@@ -21,17 +21,17 @@ $ source /path/to/venv/bin/activate
## Installing the library
-You can now use `pip` to install the library:
+You can now use `pip` to install the library and its dependencies:
```
-python3 -m pip install scanspec
+$ python3 -m pip install scanspec
```
If you require a feature that is not currently released you can also install
from github:
```
-python3 -m pip install git+git://github.com/dls-controls/scanspec.git
+$ python3 -m pip install git+https://github.com/dls-controls/scanspec.git
```
If you need to do any plotting (recommended), you should install the `plotting` extra:
@@ -51,5 +51,5 @@ The library should now be installed and the commandline interface on your path.
You can check the version that has been installed by typing:
```
-scanspec --version
+$ scanspec --version
```
diff --git a/main/_static/documentation_options.js b/main/_static/documentation_options.js
index 1d0f3bee..30e5f107 100644
--- a/main/_static/documentation_options.js
+++ b/main/_static/documentation_options.js
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
- VERSION: '0.6.5',
+ VERSION: '0.6.6.dev6+g11e1e20',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
diff --git a/main/explanations.html b/main/explanations.html
index 9c3509c6..7439bf85 100644
--- a/main/explanations.html
+++ b/main/explanations.html
@@ -8,7 +8,7 @@
- Explanations — scanspec 0.6.5 documentation
+ Explanations — scanspec 0.6.6.dev6+g11e1e20 documentation
@@ -39,7 +39,7 @@
-
+
@@ -49,13 +49,13 @@
-
+
@@ -178,13 +178,6 @@
-
-
Architectural decisions are made throughout a project’s lifetime. As a way of keeping track of these decisions, we record these decisions in Architecture Decision Records (ADRs) listed below.
This module will use a fixed set of tools as developed in python-copier-template
+and can pull from this template to update the packaging to the latest techniques.
+
As such, the developer environment may have changed, the following could be
+different:
Contributions and issues are most welcome! All issues and pull requests are
+handled through GitHub. Also, please check for any existing issues before
+filing a new one. If you have a great idea but it involves big changes, please
+file a ticket before making a pull request! We want to make sure you don’t spend
+your time coding something that might not fit the scope of the project.
Github also offers discussions as a place to ask questions and share ideas. If
+your issue is open ended and it is not obvious when it can be “closed”, please
+raise it as a discussion instead.
While 100% code coverage does not make a library bug-free, it significantly
+reduces the number of easily caught bugs! Please make sure coverage remains the
+same or is improved by a pull request!
It is recommended that developers use a vscode devcontainer. This repository contains configuration to set up a containerized development environment that suits its own needs.
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template’s How-to guides.