Skip to content

Commit 246da4f

Browse files
committed
Update to copier template 2.3.0
1 parent 42ee5ae commit 246da4f

25 files changed

+5899
-59
lines changed

.copier-answers.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 2.1.0-40-g9e70b8b
2+
_commit: 2.3.0
33
_src_path: gh:DiamondLightSource/python-copier-template
44
author_email: gary.yendell@diamond.ac.uk
55
author_name: Gary Yendell
6+
component_lifecycle: experimental
67
component_owner: user:mef65357
8+
component_type: service
79
description: Eiger control system integration with FastCS
8-
distribution_name: eiger-fastcs
10+
distribution_name: fastcs-eiger
911
docker: true
1012
docs_type: sphinx
1113
git_platform: github.com
1214
github_org: DiamondLightSource
13-
package_name: eiger_fastcs
15+
package_name: fastcs_eiger
1416
pypi: true
15-
repo_name: eiger-fastcs
17+
repo_name: fastcs-eiger
1618
type_checker: mypy

.github/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Contribute to the project
22

33
Contributions and issues are most welcome! All issues and pull requests are
4-
handled through [GitHub](https://github.com/DiamondLightSource/eiger-fastcs/issues). Also, please check for any existing issues before
4+
handled through [GitHub](https://github.com/DiamondLightSource/fastcs-eiger/issues). Also, please check for any existing issues before
55
filing a new one. If you have a great idea but it involves big changes, please
66
file a ticket before making a pull request! We want to make sure you don't spend
77
your time coding something that might not fit the scope of the project.
88

99
## Issue or Discussion?
1010

11-
Github also offers [discussions](https://github.com/DiamondLightSource/eiger-fastcs/discussions) as a place to ask questions and share ideas. If
11+
Github also offers [discussions](https://github.com/DiamondLightSource/fastcs-eiger/discussions) as a place to ask questions and share ideas. If
1212
your issue is open ended and it is not obvious when it can be "closed", please
1313
raise it as a discussion instead.
1414

@@ -24,4 +24,4 @@ It is recommended that developers use a [vscode devcontainer](https://code.visua
2424

2525
This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.
2626

27-
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](https://diamondlightsource.github.io/python-copier-template/2.1.0/how-to.html).
27+
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](https://diamondlightsource.github.io/python-copier-template/2.3.0/how-to.html).

.github/pages/make_switcher.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Make switcher.json to allow docs to switch between different versions."""
2+
13
import json
24
import logging
35
from argparse import ArgumentParser
@@ -6,6 +8,7 @@
68

79

810
def report_output(stdout: bytes, label: str) -> list[str]:
11+
"""Print and return something received frm stdout."""
912
ret = stdout.decode().strip().split("\n")
1013
print(f"{label}: {ret}")
1114
return ret
@@ -52,21 +55,20 @@ def get_versions(ref: str, add: str | None) -> list[str]:
5255
return versions
5356

5457

55-
def write_json(path: Path, repository: str, versions: str):
58+
def write_json(path: Path, repository: str, versions: list[str]):
59+
"""Write the JSON switcher to path."""
5660
org, repo_name = repository.split("/")
57-
pages_url = f"https://{org}.github.io"
58-
if repo_name != f"{org}.github.io":
59-
# Only add the repo name if it isn't the source for the org pages site
60-
pages_url += f"/{repo_name}"
6161
struct = [
62-
{"version": version, "url": f"{pages_url}/{version}/"} for version in versions
62+
{"version": version, "url": f"https://{org}.github.io/{repo_name}/{version}/"}
63+
for version in versions
6364
]
6465
text = json.dumps(struct, indent=2)
6566
print(f"JSON switcher:\n{text}")
6667
path.write_text(text, encoding="utf-8")
6768

6869

6970
def main(args=None):
71+
"""Parse args and write switcher."""
7072
parser = ArgumentParser(
7173
description="Make a versions.json file from gh-pages directories"
7274
)

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ cov.xml
5555

5656
# Sphinx documentation
5757
docs/_build/
58+
docs/_api
5859

5960
# PyBuilder
6061
target/

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ RUN mkdir -p /epics/opi
3030
WORKDIR /epics/opi
3131

3232
# change this entrypoint if it is not the same as the repo
33-
ENTRYPOINT ["eiger-fastcs"]
33+
ENTRYPOINT ["fastcs-eiger"]
3434
CMD ["--version"]

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
[![CI](https://github.com/DiamondLightSource/eiger-fastcs/actions/workflows/ci.yml/badge.svg)](https://github.com/DiamondLightSource/eiger-fastcs/actions/workflows/ci.yml)
2-
[![Coverage](https://codecov.io/gh/DiamondLightSource/eiger-fastcs/branch/main/graph/badge.svg)](https://codecov.io/gh/DiamondLightSource/eiger-fastcs)
3-
[![PyPI](https://img.shields.io/pypi/v/eiger-fastcs.svg)](https://pypi.org/project/eiger-fastcs)
1+
[![CI](https://github.com/DiamondLightSource/fastcs-eiger/actions/workflows/ci.yml/badge.svg)](https://github.com/DiamondLightSource/fastcs-eiger/actions/workflows/ci.yml)
2+
[![Coverage](https://codecov.io/gh/DiamondLightSource/fastcs-eiger/branch/main/graph/badge.svg)](https://codecov.io/gh/DiamondLightSource/fastcs-eiger)
3+
[![PyPI](https://img.shields.io/pypi/v/fastcs-eiger.svg)](https://pypi.org/project/fastcs-eiger)
44
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
55

6-
# Eiger FastCS
6+
# FastCS Eiger
77

88
Control system integration for Dectris Eiger detectors using FastCS.
99

@@ -23,14 +23,13 @@ Control system integration for Dectris Eiger detectors using FastCS.
2323

2424
ii. `podman run --rm -it -v /tmp/opi:/epics/opi --net=host ghcr.io/DiamondLightSource/eiger-fastcs:latest`
2525

26-
Source | <https://github.com/DiamondLightSource/eiger-fastcs>
26+
Source | <https://github.com/DiamondLightSource/fastcs-eiger>
2727
:---: | :---:
28-
PyPI | `pip install eiger-fastcs`
29-
Docker | `docker run ghcr.io/diamondlightsource/eiger-fastcs:latest`
30-
Documentation | <https://diamondlightsource.github.io/eiger-fastcs>
31-
Releases | <https://github.com/DiamondLightSource/eiger-fastcs/releases>
32-
28+
PyPI | `pip install fastcs-eiger`
29+
Docker | `docker run ghcr.io/diamondlightsource/fastcs-eiger:latest`
30+
Documentation | <https://diamondlightsource.github.io/fastcs-eiger>
31+
Releases | <https://github.com/DiamondLightSource/fastcs-eiger/releases>
3332

3433
<!-- README only content. Anything below this line won't be included in index.md -->
3534

36-
See https://diamondlightsource.github.io/eiger-fastcs for more detailed documentation.
35+
See https://diamondlightsource.github.io/fastcs-eiger for more detailed documentation.

catalog-info.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
apiVersion: backstage.io/v1alpha1
22
kind: Component
33
metadata:
4-
name: eiger-fastcs
5-
title: eiger-fastcs
4+
name: fastcs-eiger
5+
title: fastcs-eiger
66
description: Eiger control system integration with FastCS
77
spec:
8-
type: documentation
8+
type: service
99
lifecycle: experimental
1010
owner: user:mef65357

client.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import numpy as np
2+
import zmq
3+
4+
context = zmq.Context()
5+
6+
# Socket to talk to server
7+
print("Connecting to hello world server...")
8+
socket = context.socket(zmq.REQ)
9+
socket.connect("tcp://localhost:5555")
10+
11+
# Do 10 requests, waiting each time for a response
12+
for request in range(10):
13+
print(f"Sending request {request} ...")
14+
socket.send(np.zeros(shape=(4096, 4096), dtype=np.float64))
15+
16+
# Get the reply.
17+
message = socket.recv()
18+
print(f"Received reply {request} [ {message} ]")

docs/_api.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
:orphan:
2+
3+
..
4+
This page is not included in the TOC tree, but must exist so that the
5+
autosummary pages are generated for fastcs_eiger and all its
6+
subpackages
7+
8+
API
9+
===
10+
11+
.. autosummary::
12+
:toctree: _api
13+
:template: custom-module-template.rst
14+
:recursive:
15+
16+
fastcs_eiger
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{ ('``' + fullname + '``') | underline }}
2+
3+
{%- set filtered_members = [] %}
4+
{%- for item in members %}
5+
{%- if item in functions + classes + exceptions + attributes %}
6+
{% set _ = filtered_members.append(item) %}
7+
{%- endif %}
8+
{%- endfor %}
9+
10+
.. automodule:: {{ fullname }}
11+
:members:
12+
13+
{% block modules %}
14+
{% if modules %}
15+
.. rubric:: Submodules
16+
17+
.. autosummary::
18+
:toctree:
19+
:template: custom-module-template.rst
20+
:recursive:
21+
{% for item in modules %}
22+
{{ item }}
23+
{%- endfor %}
24+
{% endif %}
25+
{% endblock %}
26+
27+
{% block members %}
28+
{% if filtered_members %}
29+
.. rubric:: Members
30+
31+
.. autosummary::
32+
:nosignatures:
33+
{% for item in filtered_members %}
34+
{{ item }}
35+
{%- endfor %}
36+
{% endif %}
37+
{% endblock %}

docs/conf.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
# Configuration file for the Sphinx documentation builder.
2-
#
3-
# This file only contains a selection of the most common options. For a full
4-
# list see the documentation:
5-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
1+
"""Configuration file for the Sphinx documentation builder.
2+
3+
This file only contains a selection of the most common options. For a full
4+
list see the documentation:
5+
https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
"""
67

78
import sys
89
from pathlib import Path
910
from subprocess import check_output
1011

1112
import requests
1213

13-
import eiger_fastcs
14+
import fastcs_eiger
1415

1516
# -- General configuration ------------------------------------------------
1617

1718
# General information about the project.
18-
project = "eiger-fastcs"
19+
project = "fastcs-eiger"
1920

2021
# The full version, including alpha/beta/rc tags.
21-
release = eiger_fastcs.__version__
22+
release = fastcs_eiger.__version__
2223

2324
# The short X.Y version.
2425
if "+" in release:
@@ -32,6 +33,8 @@
3233
extensions = [
3334
# Use this for generating API docs
3435
"sphinx.ext.autodoc",
36+
# and making summary tables at the top of API docs
37+
"sphinx.ext.autosummary",
3538
# This can parse google style docstrings
3639
"sphinx.ext.napoleon",
3740
# For linking to external sphinx documentation
@@ -80,6 +83,12 @@
8083
# Don't inherit docstrings from baseclasses
8184
autodoc_inherit_docstrings = False
8285

86+
# Document only what is in __all__
87+
autosummary_ignore_module_all = False
88+
89+
# Add any paths that contain templates here, relative to this directory.
90+
templates_path = ["_templates"]
91+
8392
# Output graphviz directive produced images in a scalable format
8493
graphviz_output_format = "svg"
8594

@@ -119,7 +128,7 @@
119128
# a list of builtin themes.
120129
#
121130
html_theme = "pydata_sphinx_theme"
122-
github_repo = "eiger-fastcs"
131+
github_repo = "fastcs-eiger"
123132
github_user = "DiamondLightSource"
124133
switcher_json = f"https://{github_user}.github.io/{github_repo}/switcher.json"
125134
switcher_exists = requests.get(switcher_json).ok

docs/how-to/run-container.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Run in a container
22

3-
Pre-built containers with eiger-fastcs and its dependencies already
4-
installed are available on [Github Container Registry](https://ghcr.io/DiamondLightSource/eiger-fastcs).
3+
Pre-built containers with fastcs-eiger and its dependencies already
4+
installed are available on [Github Container Registry](https://ghcr.io/DiamondLightSource/fastcs-eiger).
55

66
## Starting the container
77

88
To pull the container from github container registry and run:
99

1010
```
11-
$ docker run ghcr.io/diamondlightsource/eiger-fastcs:latest --version
11+
$ docker run ghcr.io/diamondlightsource/fastcs-eiger:latest --version
1212
```
1313

1414
To get a released version, use a numbered release instead of `latest`.

docs/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Technical reference material including APIs and release notes.
66
:maxdepth: 1
77
:glob:
88
9-
reference/*
9+
API <_api/fastcs_eiger>
1010
genindex
11-
Release Notes <https://github.com/DiamondLightSource/eiger-fastcs/releases>
11+
Release Notes <https://github.com/DiamondLightSource/fastcs-eiger/releases>
1212
```

docs/tutorials/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ $ source /path/to/venv/bin/activate
2424
You can now use `pip` to install the library and its dependencies:
2525

2626
```
27-
$ python3 -m pip install eiger-fastcs
27+
$ python3 -m pip install fastcs-eiger
2828
```
2929

3030
If you require a feature that is not currently released you can also install
3131
from github:
3232

3333
```
34-
$ python3 -m pip install git+https://github.com/DiamondLightSource/eiger-fastcs.git
34+
$ python3 -m pip install git+https://github.com/DiamondLightSource/fastcs-eiger.git
3535
```
3636

3737
The library should now be installed and the commandline interface on your path.
3838
You can check the version that has been installed by typing:
3939

4040
```
41-
$ eiger-fastcs --version
41+
$ fastcs-eiger --version
4242
```

eiger-fastcs.code-workspace

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
},
6+
{
7+
"path": "../odin-fastcs"
8+
},
9+
{
10+
"path": "../odin-data"
11+
},
12+
{
13+
"path": "../FastCS"
14+
},
15+
{
16+
"path": "../tickit-devices"
17+
},
18+
{
19+
"path": "../eiger-detector"
20+
},
21+
{
22+
"path": "../tickit"
23+
},
24+
{
25+
"path": "../pvi"
26+
}
27+
],
28+
"settings": {}
29+
}

0 commit comments

Comments
 (0)