semvec/pypi-packages huggingface dataset:
function-tool 0.0.4
some usual tool with class
License: MIT

### function_tool工具包

安装：
```shell
pip install function_tool
```

本工具包对一些常用的功能进行了Python封装，目前主要包含以下功能：

### 1. 日期时间类
DateTimeTool
+ timestamp2time函数：Unix时间戳转时间字符串
+ time2timestamp函数：时间字符串转Unix时间戳
+ get_range_of_date_by_str函数：返回给定时间所在日期的时间戳范围
+ get_difference_between_time函数：返回给定的两个时间的差值
使用示例
```python
from function_tool_derrick.UsualTool import DateTimeTool    # 导入function_tool_derrick.UsualTool下的DateTimeTool类

if __name__ == '__main__':
    print(DateTimeTool.timestamp2time(1681721029)) # 打印 2023-04-17 16:43:49
    print(DateTimeTool.time2timestamp('2023-04-17 16:43:49')) # 打印 1681721029

    ret = DateTimeTool.get_range_of_date_by_str('2022-02-02 15:30:28', formatter='%Y-%m-%d %H:%M:%S', tsType=TimestampType.MILLISECOND)
    print(ret) # 打印 [1643731200000, 1643817599999]

    print(DateTimeTool.get_difference_between_time('2024-02-20 08:30:00', '2024-02-20 08:31:30'))   # 打印90
```
multibodypendulum 0.2.4
Simulates a multi-body-pendulum
License: MIT
Requires Python: >=3.10

# Multi body pendulum


[![Build Status][build-image]][build-url]
[![Code Coverage][coverage-image]][coverage-url]

<!-- Badges: -->

[build-image]: https://github.com/tueboesen/multi-body-pendulum/actions/workflows/build.yaml/badge.svg
[build-url]: https://github.com/tueboesen/multi-body-pendulum/actions/workflows/build.yaml
[coverage-image]: https://codecov.io/gh/tueboesen/multi-body-pendulum/branch/master/graph/badge.svg
[coverage-url]: https://codecov.io/gh/tueboesen/multi-body-pendulum/

Simulation software for multi-body pendulums using Runge-Kutta 4, and with vizualization of the pendulum:

![5-body pendulum animation](https://github.com/tueboesen/multi-body-pendulum/blob/master/docs/multibodypendulum.gif)

and the energy:

![Energy](https://github.com/tueboesen/multi-body-pendulum/blob/master/docs/energy.png)

My notes/derivation of the governing system of equations for this system can be found 
[here](https://github.com/tueboesen/multi-body-pendulum/blob/master/docs/n-pendulum.pdf).

## Installation
    pip install multibodypendulum

## Quick start
A quick usecase to simulate a 5 pendulum system could look like this

    import multibodypendulum as mbp
    n = 5
    dt = 0.001
    g = 9.82
    model = mbp.MultiBodyPendulum(n, dt,g=g)
    theta0 = 0.5*math.pi*torch.ones(n)
    dtheta0 = 0.0*torch.ones(n)
    nsteps = 100
    times, thetas, dthetas = model.simulate(nsteps,theta0,dtheta0)
    model.plot_energy()
    model.animate_pendulum()

## Limitations
The code has some limitations:
- The simulation assumes pendulums of mass 1 kg, and length between pendulums of 1 m. These assumptions significantly speeds up the simulation and was all I needed for my usecase.

## Contribution
- The simulation uses pytorch, but could easily be ported to numpy, which would make it easier to use for a lot of people. I haven't done this since I primarily use pytorch so it doesn't matter to me, but if others need it, it could be a nice contribution project.