Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .flake8

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/Lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint-and-test
on: [pull_request, workflow_call]
jobs:
call-linter-workflow:
uses: ISISComputingGroup/reusable-workflows/.github/workflows/linters.yml@main
with:
compare-branch: origin/main
python-ver: '3.11'
tests:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['3.10','3.11']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- name: install requirements
run: pip install -e .[dev]
- name: run unit tests
run: python -m pytest .
- name: run system tests
working-directory: ./system_tests
run: python -m pytest --approvaltests-use-reporter='PythonNativeReporter' lewis_tests.py
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [call-linter-workflow, tests]
steps:
- run: exit 1
# see https://stackoverflow.com/a/67532120/4907315
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}
8 changes: 8 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: sphinx

on: [push, pull_request, workflow_call]

jobs:
call_sphinx_builder:
uses: ISISComputingGroup/reusable-workflows/.github/workflows/sphinx.yml@main
secrets: inherit
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
.cache
dist/
build/
docs/_build/
doc/_build/
lewis.egg-info
.DS_Store
.venv
doc/generated
_build
.approval_tests_temp
8 changes: 0 additions & 8 deletions .isort.cfg

This file was deleted.

78 changes: 0 additions & 78 deletions Jenkinsfile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
Lewis - Let's write intricate simulators.

Lewis is a Python framework for simulating hardware devices. It is
compatible with Python 3.7 to 3.11.
compatible with Python 3.10 to 3.11.

It is currently not compatible with 3.12 as the asyncchat module has been removed from Python.
We are going to fix this at some point.

Lewis can be installed via pip or ran from source. See relevant usage sections of the docs for more details.

Resources:
[GitHub](https://github.com/ess-dmsc/lewis)
[GitHub](https://github.com/ISISComputingGroup/lewis)
[PyPI](https://pypi.python.org/pypi/lewis)

Lewis was previously named "Plankton" but, due to a
Expand Down
11 changes: 11 additions & 0 deletions doc/_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:orphan:

API
===

.. autosummary::
:toctree: generated
:template: custom-module-template.rst
:recursive:

lewis
40 changes: 40 additions & 0 deletions doc/_templates/custom-module-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@


{{ ('``' + fullname + '``') | underline }}

{%- set filtered_members = [] %}
{%- for item in members %}
{%- if item in functions + classes + exceptions + attributes %}
{% set _ = filtered_members.append(item) %}
{%- endif %}
{%- endfor %}

.. automodule:: {{ fullname }}
:members:
:show-inheritance:

{% block modules %}
{% if modules %}
.. rubric:: Submodules

.. autosummary::
:toctree:
:template: custom-module-template.rst
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block members %}
{% if filtered_members %}
.. rubric:: Members

.. autosummary::
:nosignatures:
{% for item in filtered_members %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
37 changes: 37 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
#
# lewis documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 9 16:42:53 2016.
import os
import sys
sys.path.insert(0, os.path.abspath("../lewis"))


# -- General configuration ------------------------------------------------
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
# and making summary tables at the top of API docs
"sphinx.ext.autosummary",
# This can parse google style docstrings
"sphinx.ext.napoleon",
# For linking to external sphinx documentation
"sphinx.ext.intersphinx",
# Add links to source code in API docs
"sphinx.ext.viewcode",
]
templates_path = ["_templates"]
# General information about the project.
project = u"lewis"
language = 'en'
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# -- Options for HTML output ---------------------------------------------
suppress_warnings =["docutils"]
html_theme = "sphinx_rtd_theme"
html_logo = "resources/logo/lewis-logo.png"

autoclass_content = "both"
myst_heading_anchors = 3

napoleon_google_docstring = False
napoleon_numpy_docstring = True
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Begin by checking-out the source from GitHub:

```
(lewis-dev)$ git clone https://github.com/ess-dmsc/lewis.git
(lewis-dev)$ git clone https://github.com/ISISComputingGroup/lewis.git
```

To develop Lewis, it is strongly recommended to work in a dedicated virtual environment, otherwise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ prior to proceeding to the next section.

### Git Milestones

- Go to https://github.com/ess-dmsc/lewis/milestones
- Go to https://github.com/ISISComputingGroup/lewis/milestones
- Ensure all issues and PRs included in this release are tagged correctly
- Create milestone for next release
- Ensure any open issues or PRs not included are tagged for next release
Expand All @@ -33,7 +33,7 @@ prior to proceeding to the next section.
- Update `version` in `setup.py`

### GitHub Release
- Draft release blurb at https://github.com/ess-dmsc/lewis/releases
- Draft release blurb at https://github.com/ISISComputingGroup/lewis/releases

### Merge Changes
- Merge any changes made in this section into the main branch
Expand All @@ -49,7 +49,7 @@ This should be done in a clean directory.
```
$ python -m venv build
$ . build/bin/activate
(build) $ git clone https://github.com/ess-dmsc/lewis.git
(build) $ git clone https://github.com/ISISComputingGroup/lewis.git
(build) $ cd lewis
(build) $ pip install twine wheel
(build) $ python setup.py sdist bdist_wheel
Expand Down Expand Up @@ -84,9 +84,9 @@ work as expected.

### Git Release
- Finalize and submit release blurb at:
https://github.com/ess-dmsc/lewis/releases
https://github.com/ISISComputingGroup/lewis/releases
- Close the current milestone at:
https://github.com/ess-dmsc/lewis/milestones
https://github.com/ISISComputingGroup/lewis/milestones

### Upload PyPI Package
The ``twine`` utility can be used to upload the packages to PyPI:
Expand Down
48 changes: 48 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Welcome to the Lewis documentation!
===================================
Lewis is a Python package that makes it easy to develop complex stateful device simulations. It
is licensed under GPL version 3 and the source is available on github_, where you are welcome to
open new issues so the package can improve.

Documentation contents:

Quickstart
==========
.. toctree::
:maxdepth: 2
:glob:
:caption: Quickstart

quickstart


.. toctree::
:maxdepth: 2
:glob:
:caption: User guide

user_guide/*


.. toctree::
:maxdepth: 1
:glob:
:caption: Developer guide

developer_guide/*

.. toctree::
:maxdepth: 1
:caption: Release notes
:glob:

release_notes/release_notes*

.. toctree::
:titlesonly:
:caption: API reference

_api


.. _github: https://github.com/ISISComputingGroup/lewis
2 changes: 1 addition & 1 deletion docs/quickstart.md → doc/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ P?
9.106584
```

See [the source code](https://github.com/ess-dmsc/lewis/blob/main/lewis/examples/example_motor/__init__.py) of the example motor if you want to see what makes it tick.
See [the source code](https://github.com/ISISComputingGroup/lewis/blob/main/lewis/examples/example_motor/__init__.py) of the example motor if you want to see what makes it tick.

## Connect to Motor via Control Client
In addition to the simulated TCP Stream interface, Lewis provides a so-called Control Server interface, which allows you to bypass the normal device protocol and access both device and simulation parameters directly while the simulation is running. This can be very useful for debugging and diagnostics, without having to modify the main device interface.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
This is a minor release that adds a feature for sending unsolicited messages.

## New Features
- Added function for sending unsolicited messages to a device. See [here](https://github.com/ess-dmsc/lewis/commit/08a335a8b11661478c97fd88e3e7d6bb9fcea866).
- Added function for sending unsolicited messages to a device. See [here](https://github.com/ISISComputingGroup/lewis/commit/08a335a8b11661478c97fd88e3e7d6bb9fcea866).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions doc/release_notes/release_notes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _release_notes:

Release notes
=============
.. toctree::
:maxdepth: 1
:glob:

*
File renamed without changes.
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This page documents the program usage for ``lewis`` and ``lewis-control``, the t
tools provided as part of a Lewis installation.

## lewis
See `lewis.scripts.run`
See {py:meth}`lewis.scripts.run`

## lewis-control
See `lewis.scripts.control`
See {py:meth}`lewis.scripts.control`
Loading