Pamoja.Kit
0.1.17
dotnet add package Pamoja.Kit --version 0.1.17
NuGet\Install-Package Pamoja.Kit -Version 0.1.17
<PackageReference Include="Pamoja.Kit" Version="0.1.17" />
<PackageVersion Include="Pamoja.Kit" Version="0.1.17" />
<PackageReference Include="Pamoja.Kit" />
paket add Pamoja.Kit --version 0.1.17
#r "nuget: Pamoja.Kit, 0.1.17"
#:package Pamoja.Kit@0.1.17
#addin nuget:?package=Pamoja.Kit&version=0.1.17
#tool nuget:?package=Pamoja.Kit&version=0.1.17
Pamoja.Kit
Plain-language helper math: smoothing, calibration, PID and thermostat control, trend and surge prediction, rolling windows, kinematics, and geo. One capability of pamoja, one memory-safe Rust core with bindings for TypeScript, Python, and C#.
Install
dotnet add package Pamoja.Kit
using Pamoja.Kit;
This pulls in Pamoja.Native, the compiled engine. dotnet add package Pamoja is the whole framework in one package.
Example
The guide project's example, spliced here as it ran in CI.
From bindings/dotnet/samples/Pamoja.Guides/KitGuide.cs:
// A 4-20 mA process loop carries the level as a current: 4 mA is empty and 20 mA
// is full, so the span is 16 mA and mid-scale is 12 mA, not 10.
Calibration level = Calibration.TwoPoint(4.0f, 0.0f, 20.0f, 100.0f);
Console.WriteLine($"12 mA is {level.Apply(12.0f)}% full, 4 mA is {level.Apply(4.0f)}%");
// The live zero is what makes a broken loop detectable: 0 mA is off the bottom of
// the scale rather than an empty tank.
float broken = level.Apply(0.0f);
Console.WriteLine($"a dead loop reads {broken}%, which is not a level at all");
// A median window drops that sample outright, where an average would blend a
// quarter of the range into every reading after it.
using var filtered = new Median();
float percent = 0.0f;
foreach (float milliamps in new[] { 12.0f, 12.0f, 0.0f, 12.0f, 12.0f })
{
percent = level.Apply(filtered.Update(milliamps));
}
Console.WriteLine($"through the dropout, the level held at {percent}%");
// A refill pump runs when the level falls below the deadband, which is the
// direction heating names; nothing about it is specific to temperature. The
// deadband stops a level sitting on the threshold from chattering the contactor.
using var pump = Thermostat.Heating(50.0f, 10.0f);
foreach (float reading in new[] { percent, 38.0f, 45.0f, 62.0f })
{
Console.WriteLine($"at {reading}% the pump is {(pump.Update(reading) ? "on" : "off")}");
}
The same capability in every language
| Language | Package | Reference |
|---|---|---|
| Rust | pamoja-kit |
reference, docs.rs, install |
| TypeScript | @pamoja/kit |
reference, install |
| Python | pamoja-kit |
reference, install |
| C# | Pamoja.Kit |
reference, install |
Documentation
Pamoja.Kitreference, every type in this namespace.- The Helpers guide, with the same example in Rust, TypeScript, and Python.
- Every capability, and the install page.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Pamoja.Native (>= 0.1.17)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Pamoja.Kit:
| Package | Downloads |
|---|---|
|
Pamoja
The whole pamoja framework in one package: every capability of one memory-safe Rust core, behind an idiomatic C# facade, for IoT, robotics, and drones. |
GitHub repositories
This package is not used by any popular GitHub repositories.