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
2 changes: 1 addition & 1 deletion .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '*'

env:
GCR_IMAGE: ghcr.io/rayemelyanova/diffcalc-api
GCR_IMAGE: ghcr.io/diamondlightsource/diffcalc-api
HELM_VERSION: 0.1.0

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Make openapi.json
run: |
python src/diffcalc_API/openapi.py
python src/diffcalc_api/openapi.py

- name: Upload
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion .gitremotes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github git@github.com:dls-controls/diffcalc_API.git
github git@github.com:DiamondLightSource/diffcalc-api.git
8 changes: 4 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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: https://github.com/dls-controls/diffcalc_API/issues
.. _GitHub: git@github.com:DiamondLightSource/diffcalc-api.git

Running the tests
-----------------

To get the source source code and run the unit tests, run::

$ git clone git://github.com/dls-controls/diffcalc_API.git
$ cd diffcalc_API
$ git clone git@github.com:DiamondLightSource/diffcalc-api.git
$ cd diffcalc-api
$ pip install -e .[dev]
$ pytest

Expand Down Expand Up @@ -102,7 +102,7 @@ To make a new release, please follow this checklist:
- Push to internal gitlab and do a dls-release.py of the tag
- Check and edit for clarity the autogenerated GitHub release_

.. _release: https://github.com/dls-controls/diffcalc_API/releases
.. _release: https://github.com/DiamondLightSource/diffcalc-api/releases

Updating the tools
------------------
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Install python and copy over repo files
FROM python:3.8

ENV ENV_DIR /diffcalc_API
ENV ENV_DIR /diffcalc_api
WORKDIR ${ENV_DIR}

COPY . ${ENV_DIR}
Expand All @@ -11,4 +11,4 @@ RUN pip install . -c requirements.txt


#Run the API
CMD ["uvicorn", "src.diffcalc_API.server:app", "--host", "0.0.0.0"]
CMD ["uvicorn", "src.diffcalc_api.server:app", "--host", "0.0.0.0"]
31 changes: 15 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
diffcalc_API
diffcalc-api
===========================

|code_ci| |docs_ci| |coverage| |pypi_version| |license|

An API which exposes the methods in diffcalc-core using FastAPI.

============== ==============================================================
PyPI ``pip install diffcalc_API``
Source code https://github.com/dls-controls/diffcalc_API
Documentation https://dls-controls.github.io/diffcalc_API
Releases https://github.com/dls-controls/diffcalc_API/releases
Source code https://github.com/DiamondLightSource/diffcalc-api
Documentation https://github.com/DiamondLightSource/diffcalc-api
Releases https://github.com/DiamondLightSource/diffcalc-api/releases
============== ==============================================================

This is where you should put some images/code snippets that illustrate
Expand All @@ -18,31 +17,31 @@ introductory code here:

.. code:: python

from diffcalc_API.hello import HelloClass
from diffcalc_api.hello import HelloClass

hello = HelloClass("me")
print(hello.format_greeting())

Or if it is a commandline tool then you might put some example commands here::

diffcalc_API person --times=2
diffcalc_api person --times=2

No other features yet.

.. |code_ci| image:: https://github.com/dls-controls/diffcalc_API/workflows/Code%20CI/badge.svg?branch=master
:target: https://github.com/dls-controls/diffcalc_API/actions?query=workflow%3A%22Code+CI%22
.. |code_ci| image:: https://github.com/dls-controls/diffcalc_api/workflows/Code%20CI/badge.svg?branch=master
:target: https://github.com/dls-controls/diffcalc_api/actions?query=workflow%3A%22Code+CI%22
:alt: Code CI

.. |docs_ci| image:: https://github.com/dls-controls/diffcalc_API/workflows/Docs%20CI/badge.svg?branch=master
:target: https://github.com/dls-controls/diffcalc_API/actions?query=workflow%3A%22Docs+CI%22
.. |docs_ci| image:: https://github.com/dls-controls/diffcalc_api/workflows/Docs%20CI/badge.svg?branch=master
:target: https://github.com/dls-controls/diffcalc_api/actions?query=workflow%3A%22Docs+CI%22
:alt: Docs CI

.. |coverage| image:: https://codecov.io/gh/dls-controls/diffcalc_API/branch/master/graph/badge.svg
:target: https://codecov.io/gh/dls-controls/diffcalc_API
.. |coverage| image:: https://codecov.io/gh/dls-controls/diffcalc_api/branch/master/graph/badge.svg
:target: https://codecov.io/gh/dls-controls/diffcalc_api
:alt: Test Coverage

.. |pypi_version| image:: https://img.shields.io/pypi/v/diffcalc_API.svg
:target: https://pypi.org/project/diffcalc_API
.. |pypi_version| image:: https://img.shields.io/pypi/v/diffcalc_api.svg
:target: https://pypi.org/project/diffcalc_api
:alt: Latest PyPI version

.. |license| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
Expand All @@ -53,4 +52,4 @@ No other features yet.
Anything below this line is used when viewing README.rst and will be replaced
when included in index.rst

See https://dls-controls.github.io/diffcalc_API for more detailed documentation.
See https://dls-controls.github.io/diffcalc_api for more detailed documentation.
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import diffcalc_API
import diffcalc_api

# -- General configuration ------------------------------------------------

# General information about the project.
project = "diffcalc_API"
project = "diffcalc_api"

# The full version, including alpha/beta/rc tags.
release = diffcalc_API.__version__
release = diffcalc_api.__version__

# The short X.Y version.
if "+" in release:
Expand Down
4 changes: 2 additions & 2 deletions docs/explanations/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Why is something the way it is

Often, reading the code will not explain *why* it is written that way. These
explanations should be grouped together in articles here. They might include
history of diffcalc_API, architectural decisions, or the
real world tests that influenced the design of diffcalc_API.
history of diffcalc_api, architectural decisions, or the
real world tests that influenced the design of diffcalc_api.

Nothing yet to explain.
2 changes: 1 addition & 1 deletion docs/how-to/test.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
How to accomplish a task
========================

Here you would explain how to use diffcalc_API to accomplish
Here you would explain how to use diffcalc_api to accomplish
a particular task. It doesn't have to be an exhaustive guide like the tutorials,
just enough information to show someone who knows what they want to do, how to
accomplish that task.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Practical step-by-step guides for the more experienced user.

reference/api
reference/contributing
Releases <https://github.com/dls-controls/diffcalc_API/releases>
Releases <https://github.com/dls-controls/diffcalc_api/releases>
Index <genindex.html#http://>

..
Expand Down
12 changes: 6 additions & 6 deletions docs/reference/api.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
API
===

.. automodule:: diffcalc_API
.. automodule:: diffcalc_api

``diffcalc_API``
``diffcalc_api``
-----------------------------------

Internal API reference for diffcalc_API
Internal API reference for diffcalc_api

Mix verbose text with docstring and signature extraction by
using ``autoclass`` and ``autofunction`` directives instead of
``automodule`` below.

.. data:: diffcalc_API.__version__
.. data:: diffcalc_api.__version__
:type: str

Version number as calculated by https://github.com/dls-controls/versiongit

.. .. automodule:: diffcalc_API.hello
.. .. automodule:: diffcalc_api.hello
.. :members:

.. ``diffcalc_API.hello``
.. ``diffcalc_api.hello``
.. -----------------------------------------

No other modules yet.
8 changes: 4 additions & 4 deletions docs/tutorials/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ Installing the library

You can now use ``pip`` to install the library::

python3 -m pip install diffcalc_API
python3 -m pip install diffcalc_api

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/diffcalc_API.git
python3 -m pip install git+git://github.com/dls-controls/diffcalc_api.git

The library should now be installed and the commandline interface on your path.
You can check diffcalc_API has been correctly installed by typing::
You can check diffcalc_api has been correctly installed by typing::

python -c "import diffcalc_API"
python -c "import diffcalc_api"

If you observe any output, repeat the steps above and observe the outputs.
10 changes: 6 additions & 4 deletions helm/diffcalc-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1

image:
repository: ghcr.io/rayemelyanova/diffcalc_api
repository: ghcr.io/diamondlightsource/diffcalc-api
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: latest
Expand Down Expand Up @@ -43,18 +43,20 @@ service:
port: 80

ingress:
enabled: false
enabled: true
className: ""
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
- host: diffcalc.diamond.ac.uk
paths:
- path: /
pathType: ImplementationSpecific
tls: []
tls:
- hosts:
- diffcalc.diamond.ac.uk
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
Expand Down
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = diffcalc_API
name = diffcalc-api
description = API for diffcalc-core python 3 package developed by Irakli Sikharulidze
url = https://github.com/dls-controls/diffcalc_API
url = https://github.com/DiamondLightSource/diffcalc-api
author = Rose Yemelyanova
author_email = rose.yemelyanova@diamond.ac.uk
license = Apache License 2.0
Expand Down Expand Up @@ -52,7 +52,7 @@ where = src

# Specify any package data to be included in the wheel below.
# [options.package_data]
# diffcalc_API =
# diffcalc-api =
# subpackage/*.yaml

[mypy]
Expand All @@ -74,7 +74,7 @@ extend-ignore =
# Run pytest with all our checkers, and don't spam us with massive tracebacks on error
addopts =
--tb=native -vv --doctest-modules --doctest-glob="*.rst"
--cov=diffcalc_API --cov-report term --cov-report xml:cov.xml
--cov=diffcalc_api --cov-report term --cov-report xml:cov.xml
# https://iscinumpy.gitlab.io/post/bound-version-constraints/#watch-for-warnings
# filterwarnings = error #Uncomment later.
# Doctest python code in docs, python code in src docstrings, test functions in tests
Expand All @@ -84,7 +84,7 @@ testpaths =
[coverage:run]
# This is covered in the versiongit test suite so exclude it here
omit = */_version_git.py
data_file = /tmp/diffcalc_API.coverage
data_file = /tmp/diffcalc_api.coverage

[coverage:paths]
# Tests are run from installed location, map back to the src directory
Expand Down
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 @@
import motor.motor_asyncio
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorDatabase

from diffcalc_API.config import Settings
from diffcalc_api.config import Settings

settings = Settings()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Defines all errors that can be raised when accessing almost all endpoints.

Because some errors arise from persistence retrieval, those are defined in
structures within diffcalc_API.stores instead.
structures within diffcalc_api.stores instead.
"""

from diffcalc_API.errors import constraints, hkl, ub
from diffcalc_api.errors import constraints, hkl, ub

__all__ = ["hkl", "ub", "constraints"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Errors that can be raised when accessing constraints endpoints."""
import numpy as np

from diffcalc_API.config import ALL_CONSTRAINTS
from diffcalc_API.errors.definitions import (
from diffcalc_api.config import ALL_CONSTRAINTS
from diffcalc_api.errors.definitions import (
ALL_RESPONSES,
DiffcalcAPIException,
ErrorCodesBase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np

from diffcalc_API.errors.definitions import (
from diffcalc_api.errors.definitions import (
ALL_RESPONSES,
DiffcalcAPIException,
ErrorCodesBase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import numpy as np

from diffcalc_API.config import VECTOR_PROPERTIES
from diffcalc_API.errors.definitions import (
from diffcalc_api.config import VECTOR_PROPERTIES
from diffcalc_api.errors.definitions import (
ALL_RESPONSES,
DiffcalcAPIException,
ErrorCodesBase,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Examples to use in endpoints for fastAPI docs, to make it easier to read."""

from diffcalc_API.examples import ub
from diffcalc_api.examples import ub

__all__ = ["ub"]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""API examples used in diffcalc_API.routes.ub."""
"""API examples used in diffcalc_api.routes.ub."""


from diffcalc_API.models.ub import (
from diffcalc_api.models.ub import (
AddOrientationParams,
AddReflectionParams,
EditOrientationParams,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Defines all pydantic models used for endpoint requests and responses.

Ub and Hkl endpoints have specific pydantic models for their request bodies, defined in
modules diffcalc_API.models.ub and diffcalc_API.models.hkl respectively.
modules diffcalc_api.models.ub and diffcalc_api.models.hkl respectively.

Module diffcalc_API.models.response defines general endpoint response models used by
Module diffcalc_api.models.response defines general endpoint response models used by
all routes.
"""

from diffcalc_API.models import hkl, response, ub
from diffcalc_api.models import hkl, response, ub

__all__ = ["ub", "hkl", "response"]
File renamed without changes.
Loading