You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/book/src/chapter_02.md
+33-5Lines changed: 33 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,16 +42,44 @@ The alternative to running the Rattlesnake as an executable is to run it as a Py
42
42
43
43
The first step to running Rattlesnake from its Python script is to install Python. This can be done in multiple ways. Python can be downloaded and installed from the [Python website](https://www.python.org/) directly. When installed this way, Python will not include any of the numeric or scientific libraries such as [NumPy](https://numpy.org) or [SciPy](https://scipy.org). For this reason, many users will prefer to download a scientific Python distribution which contains many numeric or scientific libraries. [Anaconda](https://www.anaconda.com/) or [WinPython](https://winpython.github.io/) are popular distributions.
44
44
45
-
Regardless of the distribution selected, users will need to install packages that Rattlesnake depends on. The GitHub repository contains a [requirements.txt](https://github.com/sandialabs/rattlesnake-vibration-controller/blob/main/requirements.txt) file that can be used by the Python package manager `pip` to install all required dependencies:
45
+
### Virtual Enrivonment
46
+
47
+
It is a best practice to install Rattlesnake within a virtual environment. A virtual environment is a self-contained directory that contains a specific Python installation, along with additional packages. It allows users to create an isolated environment, ensuring that dependicies and libraries do not interfere with each other.
48
+
49
+
Create a virtual environment with either `pip` or `uv`. `pip` is already included with Python, whereas `uv` must be [installed](https://docs.astral.sh/uv/getting-started/installation/) separately. `uv` is significantly faster than `pip` (often 10–100x) and is recommended, though not required.
46
50
47
-
```sh
48
-
pip install -r requirements.txt
49
51
```
52
+
# Option 1: pip method
53
+
python -m venv .venv
54
+
55
+
# Option 2: uv method
56
+
uv venv
57
+
58
+
# For both methods, prior to installation, activate the environment, depending on which shell is in use:
59
+
60
+
source .venv/bin/activate # bash / zsh
61
+
source .venv/bin/activate.fish # fish shell
62
+
.\.venv\Scripts\activate # Windows (PowerShell/CMD)
63
+
```
64
+
65
+
### Installation
66
+
67
+
Regardless of the distribution and virtual environment generation method selected, users will need to install the dependencies
68
+
required by Rattlesnake. The project uses a `pyproject.toml` file to manage its
69
+
environment. Install the package and its dependencies directly using `pip`:
70
+
71
+
* For **standard users:**`pip install .`
72
+
* For **developers** (includes tools like `pytest` defined in the `dev` extra):
73
+
*`pip install -e .[dev]` or
74
+
*`uv pip install -e .[dev]`
75
+
76
+
The `-e` flag installs the project in *editable mode*, ensuring that any changes you make
77
+
to the source code are reflected immediately in the environment.
50
78
51
-
Note that if running through a corporate or university firewall, the proxy may need to be specified in `pip`. Additionally, on some networks the Python package repositories must be added as trusted hosts. Such a command may look like
79
+
If running through a corporate or university firewall, the proxy may need to be specified in `pip`. Additionally, on some networks the Python package repositories must be added as trusted hosts. Such a command may look like
Copy file name to clipboardExpand all lines: documentation/book/src/chapter_10.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ numbering:
16
16
(sec:sdynpy_hardware)=
17
17
# Virtual Control using SDYNPY System Objects
18
18
19
-
The final option for synthetic control in Rattlesnake is to load in a SDynPy [`System`](https://sandialabs.github.io/sdynpy/_autosummary/sdynpy.core.sdynpy_system.System.html) object, which gets stored from SDynPy using the [`sdyn.System.save`](https://sandialabs.github.io/sdynpy/_autosummary/sdynpy.core.sdynpy_system.System.html#sdynpy.core.sdynpy_system.System.save) method. SDynPy `System` objects store mass, stiffness, and damping matrices. They also store transformation matrices which transform its internal system space into the physical space. This allows SDynPy `System` objects to represent both "full" physical systems as well as "reduced" systems (e.g., Craig-Bampton or Modal systems). The final part of the SDynPy `System` is the degree of freedom information that is stored with the matrices. This maps rows of the transformation matrix (or rows of the mass, stiffness, and damping matrices if the transformation is the identity matrix) to physical degrees of freedom.
19
+
The final option for synthetic control in Rattlesnake is to load in a SDynPy [`System`](https://sandialabs.github.io/sdynpy/sdynpy-system/) object, which gets stored from SDynPy using the [`sdyn.System.save`](https://sandialabs.github.io/sdynpy/sdynpy-system/#api-sdynpy-system-save) method. SDynPy `System` objects store mass, stiffness, and damping matrices. They also store transformation matrices which transform its internal system space into the physical space. This allows SDynPy `System` objects to represent both "full" physical systems as well as "reduced" systems (e.g., Craig-Bampton or Modal systems). The final part of the SDynPy `System` is the degree of freedom information that is stored with the matrices. This maps rows of the transformation matrix (or rows of the mass, stiffness, and damping matrices if the transformation is the identity matrix) to physical degrees of freedom.
20
20
21
21
A complete example problem using a SDynPy `System` object can be found in @sec:example_sdynpy.
0 commit comments