-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from LaboratoireMecaniqueLille/release/2.0.4
Release of version 2.0.4
- Loading branch information
Showing
16 changed files
with
698 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Installs the Python dependencies, installs Crappy, and checks that it imports | ||
name: Python Package | ||
|
||
on: | ||
# Runs on pull requests targeting the default branch | ||
pull_request: | ||
types: [opened, edited, reopened, synchronize] | ||
branches: ["master", "develop"] | ||
|
||
# May also be started manually | ||
workflow_dispatch: | ||
|
||
# Runs automatically every first day of the month | ||
schedule: | ||
- cron: '0 12 1 * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: python -m pip install --upgrade pip wheel build setuptools | ||
- name: Install Crappy | ||
run: python -m pip install . | ||
- name: Import Crappy | ||
run: python -c "import crappy; print(crappy.__version__)" |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -561,6 +561,17 @@ Supported Actuators | |
This object hasn't been maintained nor tested for a while, it is not sure | ||
that it still works as expected ! | ||
|
||
- :ref:`Phidget Stepper4A` | ||
|
||
Drives 4A bipolar stepper motors using Phidget's `Stepper4A <https:// | ||
www.phidgets.com/?prodid=1278>`_ in speed or in position, by using several | ||
Phidget libraries. | ||
|
||
.. Important:: | ||
This Actuator must be connected to Phidget's VINT Hub to work. See the | ||
following link `<https://www.phidgets.com/?prodid=1278#Tab_User_Guide>`_ | ||
to connect properly to the Hub. | ||
|
||
- :ref:`Pololu Tic` | ||
|
||
Drives Pololu's `Tic <https://www.pololu.com/category/212/tic-stepper-motor- | ||
|
@@ -675,16 +686,6 @@ Sensors | |
Reads voltages from Sparfun's `'Qwiic Scale' NAU7802 <https://www.sparkfun. | ||
com/products/15242>`_ load cell conditioner. Communicates over I2C. | ||
|
||
- :ref:`PiJuice` | ||
|
||
Reads the charging status and battery level of Kubii's `PiJuice <https:// | ||
www.kubii.com/fr/14-chargeurs-alimentations-raspberry/2019-pijuice-hat-kubii | ||
-3272496008793.html>`_ Raspberry Pi power supply. | ||
|
||
.. Important:: | ||
This InOut was written for a specific application, so it may not be | ||
usable as-is in the general case. | ||
|
||
- :ref:`OpSens HandySens` | ||
|
||
Reads data from OpSens' `single channel signal conditioner <https://opsens- | ||
|
@@ -696,6 +697,26 @@ Sensors | |
This object hasn't been maintained nor tested for a while, it is not sure | ||
that it still works as expected ! | ||
|
||
- :ref:`Phidget Wheatstone Bridge` | ||
|
||
Reads volatges from Phidget's `Wheatstone Bridge <https://www.phidgets.com/ | ||
?prodid=957>`_ load cell conditioner, by using several Phidget libraries. | ||
|
||
.. Important:: | ||
This InOut must be connected to Phidget's VINT Hub to work. See the | ||
following link `<https://www.phidgets.com/?prodid=957#Tab_User_Guide>`_ to | ||
connect properly to the Hub. | ||
|
||
- :ref:`PiJuice` | ||
|
||
Reads the charging status and battery level of Kubii's `PiJuice <https:// | ||
www.kubii.com/fr/14-chargeurs-alimentations-raspberry/2019-pijuice-hat-kubii | ||
-3272496008793.html>`_ Raspberry Pi power supply. | ||
|
||
.. Important:: | ||
This InOut was written for a specific application, so it may not be | ||
usable as-is in the general case. | ||
|
||
- :ref:`Spectrum M2I 4711` | ||
|
||
Reads voltages from Spectrum's `M2i 4711 EXP <https://spectrum- | ||
|
@@ -817,6 +838,7 @@ On-the-fly data modification (Modifiers) | |
---------------------------------------- | ||
|
||
.. sectionauthor:: Antoine Weisrock <[email protected]> | ||
.. sectionauthor:: Pierre Margotin <[email protected]> | ||
|
||
- :ref:`Demux` | ||
|
||
|
@@ -828,6 +850,12 @@ On-the-fly data modification (Modifiers) | |
|
||
Calculates the time derivative of a given label. | ||
|
||
- :ref:`DownSampler` | ||
|
||
Transmits the values to downstream Blocks only once every given number of | ||
points. The values that are not sent are discarded. The values are directly | ||
sent without being altered. | ||
|
||
- :ref:`Integrate` | ||
|
||
Integrates a given label over time. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
This example demonstrates the use of the DownSampler Modifier. It does not | ||
require any specific hardware to run, but necessitates the matplotlib Python | ||
module to be installed. | ||
The DownSampler Modifier transmits only one data point every n received points | ||
received from its upstream Block. It is therefore useful for reducing the data | ||
rate in a given Link. | ||
Here, a sine wave is generated by a Generator Block and sent to two Grapher | ||
Blocks for display. One Grapher displays it as it is generated, and the other | ||
displays it downsampled by a DownSampler Modifier. Because the frequency of the | ||
sine wave is 1 Hz and the frequency of the Generator Block is twice that of the | ||
DownSampler, the value passed to the second Grapher are always close to 1 or | ||
-1, the peak of the sine wave. | ||
After starting this script, just watch how the raw signal is transformed by the | ||
DownSampler Modifier and alternates between 1 and -1. Also notice how the | ||
initial data rate of the signal is divided when passing through the DownSampler | ||
Modifier. This demo ends after 22s. You can also hit CTRL+C to stop it | ||
earlier, but it is not a clean way to stop Crappy. | ||
""" | ||
|
||
import crappy | ||
import numpy as np | ||
|
||
if __name__ == '__main__': | ||
|
||
# This Generator Block generates a sine wave for the Graphers to display. It | ||
# sends it to one Grapher that displays it as is, and to another Grapher that | ||
# receives it downsampled by the DownSampler Modifier | ||
gen = crappy.blocks.Generator( | ||
# Generating a sine wave of amplitude 2 and frequency 1 and phase pi/2 | ||
({'type': 'Sine', | ||
'condition': 'delay=20', | ||
'amplitude': 2, | ||
'freq': 1, | ||
'phase': np.pi/2},), | ||
freq=30, # Lowering the default frequency because it's just a demo | ||
cmd_label='sine', # The label carrying the generated signal | ||
|
||
# Sticking to default for the other arguments | ||
) | ||
|
||
# This Grapher Block displays the raw sine wave it receives from the | ||
# Generator. As the Generator runs at 30Hz, 30 data points are received each | ||
# second for display | ||
graph = crappy.blocks.Grapher( | ||
('t(s)', 'sine'), # The names of the labels to plot on the graph | ||
interp=False, # Not linking the displayed spots, to better see the | ||
# frequency of the input | ||
length=100, # Only displaying the data for the last 100 points | ||
|
||
# Sticking to default for the other arguments | ||
) | ||
|
||
# This Grapher Block displays the downsampled sine wave it receives from the | ||
# Generator. Because the frequency of the sine wave is 1 Hz and the frequency | ||
# of the Generator Block is twice that of the DownSampler, only values close | ||
# to 1 and -1 are received. | ||
graph_down = crappy.blocks.Grapher( | ||
('t(s)', 'sine'), # The names of the labels to plot on the graph | ||
interp=False, # Not linking the displayed spots, to better see the | ||
# frequency of the input | ||
|
||
# Sticking to default for the other arguments | ||
) | ||
|
||
# Linking the Block so that the information is correctly sent and received | ||
crappy.link(gen, graph) | ||
crappy.link(gen, graph_down, | ||
# Adding a DownSampler Modifier for downsampling the sine | ||
# wave before sending to the Grapher. A data point is sent for | ||
# display once every 15 received points | ||
modifier=crappy.modifier.DownSampler(15)) | ||
|
||
# Mandatory line for starting the test, this call is blocking | ||
crappy.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# coding: utf-8 | ||
|
||
__version__ = '2.0.3' | ||
__version__ = '2.0.4' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.