festim-dev / festim-dev/hisp

Convenience functions for pulses

Open
#35 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
9
Forks
4
PR merge metrics
No merged PRs in 30d

Description

It would be convenient to have functions like periodic step function, periodic step function with ramp up/down etc.

```python
def periodic_step_function(x, period_on, period_total, value_on, value_off=0.0):
"""
Creates a periodic step function with two periods.
"""

if period_total < period_on:
raise ValueError("period_total must be greater than period_on")

if x % period_total < period_on:
return value_on
else:
return value_off
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.