Skip to content

Releases: upkie/loop-rate-limiters

v1.0.0

09 Feb 09:55
c772902
Compare
Choose a tag to compare

This is version 1.0.0 of the project, whose API has reached a mature state. This release adds documentation and support for Python 3.11.

Added

  • Documentation
  • Support Python 3.11

v0.6.1

17 Oct 19:31
0d6b0fb
Compare
Choose a tag to compare

This patch release fixes the initialization of the slack attribute in default (synchronous) rate limiters.

[0.6.1] - 2023/10/17

Fixed

  • RateLimiter: Initialization of slack attribute

v0.6.0

01 Sep 12:43
319ffe9
Compare
Choose a tag to compare

This update adds a dt attribute to AsyncRateLimiter, matching its API better with that of the other RateLimiter.

Added

  • AsyncRateLimiter: dt property

Changed

  • AsyncRateLimiter: measured_period is now a property
  • AsyncRateLimiter: next_tick is now a property
  • AsyncRateLimiter: period is now a property
  • AsyncRateLimiter: slack is now a property

v0.5.0

25 Jul 12:39
03320bb
Compare
Choose a tag to compare

This minor update adds a warn keyword argument to the rate limiter constructors. The default behavior is warn=True as before. Setting warn=False disables the "clock tick exceeded" warnings. It can be used for instance in applications that are not time critical.

Added

  • AsyncRateLimiter: warn constructor argument
  • RateLimiter: warn constructor argument

v0.4.0

13 Apr 18:19
e77ae59
Compare
Choose a tag to compare

This minor release updates the synchronous RateLimiter so that it warns when it is running late, similarly to the asynchronous limiter.

Added

  • RateLimiter: warn when the limiter is running late

v0.3.0

20 Jan 14:33
d0e80b2
Compare
Choose a tag to compare

This release turns rate limiter internals into read-only properties and adds the RateLimiter.dt shorthand for convenience. It also introduces installation from conda-forge as a (good) alternative to PyPI.

Added

  • Installation from conda-forge
  • RateLimiter: dt property
  • RateLimiter: next_tick property

Changed

  • Attributes are now read-only
  • RateLimiter: period becomes read-only
  • RateLimiter: slack becomes read-only

v0.2.0

05 Dec 13:45
bb49c7e
Compare
Choose a tag to compare

This release adds a rate limiter for asyncio:

import asyncio
from loop_rate_limiters import AsyncRateLimiter

async def main():
    rate = AsyncRateLimiter(frequency=400.0)
    while True:
        loop_time = asyncio.get_event_loop().time()
        print(f"Hello from loop at {loop_time:.3f} s")
        await rate.sleep()

if __name__ == "__main__":
    asyncio.run(main())

Added

  • Loop rate limiter for asyncio

v0.1.1

02 Dec 16:21
Compare
Choose a tag to compare

This minor release renames to RateLimiter the rate limiter based on time.perf_counter:

from loop_rate_limiters import RateLimiter
from time import perf_counter

rate = RateLimiter(frequency=100.0)
while True:
    print(f"Hello from loop at {perf_counter():.3f} s")
    rate.sleep()

v0.1.0

02 Dec 15:49
6074a92
Compare
Choose a tag to compare

This is the initial release of the project: a simple Rate limiter based on time.perf_counter:

from loop_rate_limiters import Rate
from time import perf_counter

rate = Rate(frequency=400.0)
while True:
    print(f"Hello from loop at {perf_counter():.3f} s")
    rate.sleep()