From 075c7cd3725851cecfc605953215ae258f124fc9 Mon Sep 17 00:00:00 2001 From: Rover van der Noort Date: Fri, 31 Mar 2023 13:28:08 +0200 Subject: [PATCH] Deploy to PyPi with build and twine --- .gitignore | 1 + {GA => GATorch}/__init__.py | 0 {GA => GATorch}/ga.py | 0 {GA => GATorch}/profilers/__init__.py | 0 {GA => GATorch}/profilers/energyprofiler.py | 0 {GA => GATorch}/profilers/measurehook.py | 0 {GA => GATorch}/profilers/measurehookloss.py | 0 {GA => GATorch}/profilers/pyjoules.py | 0 examples/basic_example.py | 2 +- examples/fashion_mnist.py | 2 +- examples/no_gpu_example.py | 2 +- pyproject.toml | 25 ++++++++++++++++++++ requirements.txt | 2 ++ 13 files changed, 31 insertions(+), 3 deletions(-) rename {GA => GATorch}/__init__.py (100%) rename {GA => GATorch}/ga.py (100%) rename {GA => GATorch}/profilers/__init__.py (100%) rename {GA => GATorch}/profilers/energyprofiler.py (100%) rename {GA => GATorch}/profilers/measurehook.py (100%) rename {GA => GATorch}/profilers/measurehookloss.py (100%) rename {GA => GATorch}/profilers/pyjoules.py (100%) create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index 0d3ed20..ec1731a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ **/data /results **/runs +**/dist *.pth *.csv *.png \ No newline at end of file diff --git a/GA/__init__.py b/GATorch/__init__.py similarity index 100% rename from GA/__init__.py rename to GATorch/__init__.py diff --git a/GA/ga.py b/GATorch/ga.py similarity index 100% rename from GA/ga.py rename to GATorch/ga.py diff --git a/GA/profilers/__init__.py b/GATorch/profilers/__init__.py similarity index 100% rename from GA/profilers/__init__.py rename to GATorch/profilers/__init__.py diff --git a/GA/profilers/energyprofiler.py b/GATorch/profilers/energyprofiler.py similarity index 100% rename from GA/profilers/energyprofiler.py rename to GATorch/profilers/energyprofiler.py diff --git a/GA/profilers/measurehook.py b/GATorch/profilers/measurehook.py similarity index 100% rename from GA/profilers/measurehook.py rename to GATorch/profilers/measurehook.py diff --git a/GA/profilers/measurehookloss.py b/GATorch/profilers/measurehookloss.py similarity index 100% rename from GA/profilers/measurehookloss.py rename to GATorch/profilers/measurehookloss.py diff --git a/GA/profilers/pyjoules.py b/GATorch/profilers/pyjoules.py similarity index 100% rename from GA/profilers/pyjoules.py rename to GATorch/profilers/pyjoules.py diff --git a/examples/basic_example.py b/examples/basic_example.py index cf7c2de..acba4c4 100644 --- a/examples/basic_example.py +++ b/examples/basic_example.py @@ -3,7 +3,7 @@ import torch from torch import nn -from GA import GA +from GATorch import GA device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu" print("Using {} device".format(device)) diff --git a/examples/fashion_mnist.py b/examples/fashion_mnist.py index 93689e7..daca86f 100644 --- a/examples/fashion_mnist.py +++ b/examples/fashion_mnist.py @@ -5,7 +5,7 @@ from torch.utils.data import DataLoader from torchvision import datasets from torchvision.transforms import ToTensor -from GA import GA +from GATorch import GA device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu" print("Using {} device".format(device)) diff --git a/examples/no_gpu_example.py b/examples/no_gpu_example.py index 09f39f6..6b74d6b 100644 --- a/examples/no_gpu_example.py +++ b/examples/no_gpu_example.py @@ -2,7 +2,7 @@ sys.path.append("../") import torch from torch import nn -from GA import GA +from GATorch import GA device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu" print("Using {} device".format(device)) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..585a460 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,25 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "GATorch" +version = "0.0.1" +authors = [ + { name="Rover van der Noort", email="s.r.vandernoort@student.tudelft.nl" }, + { name="Martijn Smits", email="m.j.p.smits@student.tudelft.nl" }, + { name="Dajt Mullaj", email="d.mullaj@student.tudelft.nl" }, + { name="Remy Duijsens", email="r.w.j.p.duijsens@student.tudelft.nl" }, +] +description = "GATorch is a tool seamlessly integrated with PyTorch that enables ML developers to generate an energy consumption report. By attaching your model, the tool automatically tracks the energy consumption of your model's training and generates graphs and plots to gain in-depth insights into the energy consumption of your model." +readme = "README.md" +requires-python = ">=3.7" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] + +[project.urls] +"Homepage" = "https://github.com/GreenAITorch/GATorch" +"Bug Tracker" = "https://github.com/GreenAITorch/GATorch/issues" diff --git a/requirements.txt b/requirements.txt index cee8043..cab127a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,5 @@ matplotlib codecarbon scipy tensorboard +build +twine