Skip to content

Commit ac36091

Browse files
authored
Renames RATapi to ratapi (#49)
* Renames RATapi to ratapi * Adds numSimulationPoints description to control page
1 parent c54a973 commit ac36091

File tree

24 files changed

+44
-41
lines changed

24 files changed

+44
-41
lines changed

.github/workflows/build_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jobs:
3636
python -m pip install --upgrade pip
3737
if [ ${VERSION} == 'dev' ]; then
3838
wget https://github.com/RascalSoftware/RAT/releases/download/nightly/Linux.zip
39-
pip install RATapi
39+
pip install ratapi --upgrade
4040
else
4141
wget "https://github.com/RascalSoftware/RAT/releases/download/${VERSION}/Linux.zip"
42-
pip install RATapi==${VERSION} || pip install RATapi
42+
pip install ratapi==${VERSION} || pip install ratapi --upgrade
4343
fi
4444
unzip Linux.zip -d API/
4545
rm API/utilities/mockFunction.m # as otherwise the MATLAB reference fails to parse it

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ source/_outputs/
1818
.envrc
1919

2020
# autogenerated documentation
21-
source/reference/python/RATapi.*
21+
source/reference/python/ratapi.*
2222
source/python_examples/data/
2323
source/matlab_examples/*.html
2424
source/python_examples/notebooks/*

source/_ext/snippets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from docutils import nodes
77

8-
import RATapi
8+
import ratapi
99

1010
from sphinx.application import Sphinx
1111
from sphinx.util.docutils import SphinxDirective
@@ -44,15 +44,15 @@ def setup(app: Sphinx) -> ExtensionMetadata:
4444

4545
def setup_envs(*ignore):
4646
"""Initialise Python/MATLAB environments."""
47-
app.env.snippets_env = {"RAT": RATapi}
47+
app.env.snippets_env = {"RAT": ratapi}
4848
app.env.matlab_engine = setup_matlab()
4949
app.env.matlab_engine.eval(
5050
"cd('API'); addPaths; cd('..'); ratVars = who;", nargout=0
5151
)
5252

5353
def clear_envs(*ignore):
5454
"""Clear Python/MATLAB environments from the build environment."""
55-
app.env.snippets_env = {"RAT": RATapi}
55+
app.env.snippets_env = {"RAT": ratapi}
5656
app.env.matlab_engine.eval(
5757
r"clearvars('-except', 'ratVars', ratVars{:});", nargout=0
5858
)

source/advanced/events.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The example below registers a function to listen for the ``Plot`` event:
1919
2020
.. code-block:: Python
2121
22-
import RATapi as RAT
22+
import ratapi as RAT
2323
RAT.events.register(RAT.events.EventTypes.Plot, update_plot)
2424
2525
The event listener function is also shown below, it uses one of the plot functions provided by RAT to display the event data. The plot event data contains the current state of the reflectivity and SLDs, along with a number of other items which is detailed below.
@@ -71,7 +71,7 @@ Register a function as an event listener by providing the event type and the lis
7171
7272
.. code-block:: Python
7373
74-
import RATapi as RAT
74+
import ratapi as RAT
7575
7676
RAT.events.register(RAT.events.EventTypes.Message, handle_event) # Message Event
7777
RAT.events.register(RAT.events.EventTypes.Plot, handle_event) # Plot Event

source/calcTypes/data/domains_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import RATapi as RAT
1+
import ratapi as RAT
22
import numpy as np
33

44
problem = RAT.Project(calculation='domains')

source/conf.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
'Please download and extract the RAT release to the API folder.')
3030
sys.path.insert(0, matlab_src_dir)
3131

32-
import RATapi
33-
sys.path.insert(0, os.path.dirname(os.path.abspath(RATapi.__file__)))
32+
import ratapi
33+
sys.path.insert(0, os.path.dirname(os.path.abspath(ratapi.__file__)))
3434
project = 'RAT'
3535
copyright = u'2022-{}, ISIS Neutron and Muon Source'.format(datetime.date.today().year)
3636
author = 'Arwel Hughes, Sethu Pastula, Alex Room, Rabiya Farooq, Paul Sharp, Stephen Nneji'
@@ -52,7 +52,7 @@
5252
templates_path = ['_templates']
5353

5454
# -- Setup example files -----------------------------------------------------
55-
PYTHON_RAT_RELEASE = metadata.version("RATapi")
55+
PYTHON_RAT_RELEASE = metadata.version("ratapi")
5656

5757
MATLAB_AVAILABLE = True
5858
try:
@@ -67,14 +67,14 @@
6767
zf.extractall()
6868
print("Copying Jupyter notebooks...")
6969
for directory in ['normal_reflectivity', 'domains', 'absorption']:
70-
for file in Path(f"./python-RAT-{PYTHON_RAT_RELEASE}/RATapi/examples/{directory}/").glob('*'):
70+
for file in Path(f"./python-RAT-{PYTHON_RAT_RELEASE}/ratapi/examples/{directory}/").glob('*'):
7171
shutil.copy(file, "./python_examples/notebooks/")
7272
if MATLAB_AVAILABLE: # convert_rascal example requires matlab engine
73-
for file in Path(f"./python-RAT-{PYTHON_RAT_RELEASE}/RATapi/examples/convert_rascal_project/").glob('*'):
73+
for file in Path(f"./python-RAT-{PYTHON_RAT_RELEASE}/ratapi/examples/convert_rascal_project/").glob('*'):
7474
shutil.copy(file, "./python_examples/notebooks/")
7575

7676

77-
shutil.copytree(f"./python-RAT-{PYTHON_RAT_RELEASE}/RATapi/examples/data", "./python_examples/data", dirs_exist_ok=True)
77+
shutil.copytree(f"./python-RAT-{PYTHON_RAT_RELEASE}/ratapi/examples/data", "./python_examples/data", dirs_exist_ok=True)
7878

7979
shutil.rmtree(f"./python-RAT-{PYTHON_RAT_RELEASE}")
8080

@@ -149,7 +149,7 @@
149149
150150
<div class="admonition note">
151151
This page was generated from the notebook {{ env.docname.split('/')|last|e + '.ipynb' }} found in
152-
<a class="reference external" href="https://github.com/RascalSoftware/python-RAT/blob/"""+PYTHON_RAT_RELEASE+r"""/RATapi/examples/">the Python-RAT repository</a>.
152+
<a class="reference external" href="https://github.com/RascalSoftware/python-RAT/blob/"""+PYTHON_RAT_RELEASE+r"""/ratapi/examples/">the Python-RAT repository</a>.
153153
<a href="{{ env.docname.split('/')|last|e + '.ipynb' }}" class="reference download internal" download>Download notebook</a>.
154154
</div>
155155
@@ -159,7 +159,7 @@
159159
160160
.. code-block:: python
161161
162-
from RATapi.examples import {{ env.docname.split('/')|last|e }}
162+
from ratapi.examples import {{ env.docname.split('/')|last|e }}
163163
project, results = {{ env.docname.split('/')|last|e }}()
164164
165165
-------------------------------------------------------------------------------------

source/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ This section provides more detailed information about installing RAT for MATLAB
4747

4848
.. code-block:: console
4949
50-
pip install RATapi
50+
pip install ratapi
5151
5252
``matlabengine`` is an optional dependency only required for MATLAB related actions such as running MATLAB custom functions and converting RasCAL-1 projects.
5353
The version of ``matlabengine`` must match the version of MATLAB installed on the computer. For example, if MATLAB 2023a is installed on the computer,
5454
``matlabengine`` can be installed as shown below:
5555

5656
.. code-block:: console
5757
58-
pip install RATapi[Matlab-2023a]
58+
pip install ratapi[Matlab-2023a]
5959
6060
.. note::
6161

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ClassList
22
---------
33

4-
.. autoclass:: RATapi.ClassList
4+
.. autoclass:: ratapi.ClassList

source/reference/python/controls.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ The ``Controls`` class details control parameters for the RAT run. Note that man
55
specific to certain procedures: the relevant procedure is listed in square brackets before the
66
field description.
77

8-
.. autopydantic_model:: RATapi.Controls
8+
.. autopydantic_model:: ratapi.Controls
99
:members:

source/reference/python/core.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ RAT Core
44
This module contains the `Pybind11 <https://pybind11.readthedocs.io/en/stable/index.html>`_ objects
55
which are used to interface with RAT's C++ code.
66

7-
.. automodule:: RATapi.rat_core
7+
.. automodule:: ratapi.rat_core
88
:members:

0 commit comments

Comments
 (0)