semvec/pypi-packages huggingface dataset:
gimodules 0.3.0
Python package providing an interface to the Gantner Instruments Cloud API
Requires Python: >=3.7
Keywords: python


# gimodules-python

# Usage

### Install from PyPi

```bash 
pip install gimodules
```

Import module in python script and call functions.

A detailed description of the package and other APIs can be found in the Gantner Documentation.

```python
from gimodules.cloudconnect.cloud_request import CloudRequest

cloud = CloudRequest()
cloud.login(url='https://example.gi-cloud.io', access_token='TOKEN') # Create a token under Tools -> Monitor
cloud.get_all_stream_metadata()
```


# Development

### Information on how to manually distribute this package can be found here

https://packaging.python.org/en/latest/tutorials/packaging-projects/

**Hint:** If you are debugging the source code with a jupyter notebook, run this code in the `first cell` to enable autoreloading source code changes.

```bash
%load_ext autoreload
%autoreload 2
```

## Distribute with CI / CD
Edit setup.py version number and create a release.
-> Creating a release will trigger the workflow to push the package to PyPi

## Tests

run tests locally:

```bash
pipenv run test -v
```

or 

```bash
pytest
```

## Requirements

When starting to develop you can install the requirements with:

```bash
pip install -r requirements.txt
```

When you add new components and the requirements change, 
you can find out what packages are needed by the project and create new requirements:

```bash
pipreqs .
```

To create project all current packages installed in your venv for requirements automatically:

```bash
pip3 freeze > requirements.txt
```
---

**_NOTE:_** Remove the old gimodules version from requirements.txt before pushing (dependency conflict).

---

## Documentation

The documentation is being built as extern script in the GI.Sphinx repository.

The documentation consists of partially generated content. 
To **generate .rst files** from the code package, run the following command from the root directory of the project:

```bash
sphinx-apidoc -o docs/source/ gimodules
```
You need pandoc installed on the system itself first to build:

```bash
sudo apt install pandoc
```

Then, to **build the documentation**, run the following commands:

```bash
cd docs
sudo apt update
pip install -r requirements.txt
make html
```

## Linting / Type hints

This project follows the codestyle PEP8 and uses the linter flake8 (with line length = 100).

You can format and check the code using lint.sh:
    
```bash
./lint.sh [directory/]
```

Type hints are highly recommended.
Type hints in Python specify the expected data types of variables,
function arguments, and return values, improving code readability,
catching errors early, and aiding in IDE autocompletion.

To include type hints in the check:

```bash
mpypy=true ./lint.sh [directory])
```
cg635-clock-generator 1.1.0
Interface with a Stanford Research Systems CG635 Synthesized Clock Generator
Requires Python: >=3.10

# SRS-CG635 Synthesized Clock Generator Interface

Interface with a Stanford Research Systems CG635 Synthesized Clock Generator.

## Installation

```bash
$ pip install cg635-clock-generator
```

## Supported Features

- Frequency control
- Phase control
- CMOS output levels and standards control
- Q/*Q outputs levels and standards control
- R232 communication

## Usage

```python
from cg635_clock_generator import CG635ClockGenerator, CG635Communication

clock_generator = CG635ClockGenerator(
        communication_type=CG635Communication.RS232,
        serial_device='/dev/ttyUSB0',
)

print(clock_generator.get_identification())

FREQ = 10e6
PHASE = 90.0

clock_generator.set_frequency(FREQ)

frequency = clock_generator.get_frequency()
print(f"Frequency is {frequency} Hz")

clock_generator.set_phase(PHASE)

phase = clock_generator.get_phase()
print(f"Phase is {phase} degrees")

```

## Running tests on hardware

During normal development and for the CI the unit test suite is executed on a mock
device using pyvisa-mock. It is also possible to run tests on real hardware connected
to your system. Just call:

```bash
$ uv run poe test_hil
```

By default it will try to connect to `/dev/ttyUSB0`, but you can specify a different
device using the `--hil_serial_device` option:

```bash
$ uv run poe test_hil --hil_serial_device /dev/ttyUSB1
```

## Status

Currently only the RS232 communication has been tested on the device.

## Documentation

For more details of the module API, check the
[online documentation](http://cg635-clock-generator-leandro-lanzieri-c9d5fa14e6af42e02aa27f45.pages.desy.de/).

## Feeling like contributing?

Great! Check the [Contributing Guide](CONTRIBUTING.md) to get started.