forked from M-Labs/thermostat
pytec: Package
This commit is contained in:
parent
52e35d2a98
commit
a3a3502b5f
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,3 +3,5 @@ result
|
||||
*.bin
|
||||
|
||||
__pycache__/
|
||||
*.egg-info/
|
||||
build/
|
||||
|
14
flake.nix
14
flake.nix
@ -57,10 +57,22 @@
|
||||
dontFixup = true;
|
||||
auditable = false;
|
||||
};
|
||||
|
||||
pytec = pkgs.python3Packages.buildPythonPackage {
|
||||
pname = "pytec";
|
||||
version = "0.0.0";
|
||||
src = "${self}/pytec";
|
||||
|
||||
propagatedBuildInputs =
|
||||
with pkgs.python3Packages; [
|
||||
numpy
|
||||
matplotlib
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.x86_64-linux = {
|
||||
inherit thermostat;
|
||||
inherit thermostat pytec;
|
||||
default = thermostat;
|
||||
};
|
||||
|
||||
|
@ -4,6 +4,8 @@ import matplotlib.animation as animation
|
||||
from threading import Thread, Lock
|
||||
from pytec.client import Client
|
||||
|
||||
|
||||
def main():
|
||||
TIME_WINDOW = 300.0
|
||||
|
||||
tec = Client()
|
||||
@ -116,7 +118,7 @@ def animate(i):
|
||||
margin_y = 0.01 * (max_y - min_y)
|
||||
ax.set_ylim(min_y - margin_y, max_y + margin_y)
|
||||
|
||||
global legend
|
||||
nonlocal legend
|
||||
legend.remove()
|
||||
legend = ax.legend()
|
||||
|
||||
@ -126,3 +128,7 @@ ani = animation.FuncAnimation(
|
||||
plt.show()
|
||||
quit = True
|
||||
thread.join()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -9,4 +9,11 @@ setup(
|
||||
license="GPLv3",
|
||||
install_requires=["setuptools"],
|
||||
packages=find_packages(),
|
||||
entry_points={
|
||||
"gui_scripts": [
|
||||
"autotune = autotune:main",
|
||||
"plot = plot:main",
|
||||
]
|
||||
},
|
||||
py_modules=["autotune", "plot"],
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user