From 724be0fbb1c91d118664ff4264b6e9dc7b06f5c3 Mon Sep 17 00:00:00 2001 From: devzhk Date: Mon, 14 Jun 2021 21:57:20 -0700 Subject: [PATCH] Add cfg --- README.md | 3 ++- setup.cfg | 24 ++++++++++++++++++++++++ setup.py | 23 ----------------------- {CGDs => src/CGDs}/__init__.py | 0 {CGDs => src/CGDs}/acgd.py | 0 {CGDs => src/CGDs}/cgd.py | 0 {CGDs => src/CGDs}/cgd_utils.py | 0 7 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 setup.cfg delete mode 100644 setup.py rename {CGDs => src/CGDs}/__init__.py (100%) rename {CGDs => src/CGDs}/acgd.py (100%) rename {CGDs => src/CGDs}/cgd.py (100%) rename {CGDs => src/CGDs}/cgd_utils.py (100%) diff --git a/README.md b/README.md index 16d9962..1d0b5ae 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,8 @@ Then you need to specify the `device`, `learning rate`s. Example: ```python -import CGDs + +from src import CGDs import torch device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') optimizer = CGDs.ACGD(max_param=model_G.parameters(), min_params=model_D.parameters(), diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..46c3090 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,24 @@ +[metadata] +name = CGDs +version = 0.0.4 +author = Hongkai Zheng +author_email = devzhk@gmail.com +description = Adaptive Competitive Gradient Descent optimizer +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/devzhk/cgds-package +project_urls = + Bug Tracker = https://github.com/devzhk/cgds-package/issues +classifiers = + Programming Language :: Python :: 3 + License :: OSI Approved :: MIT License + Operating System :: OS Independent + +[options] +package_dir = + = src +packages = find: +python_requires = >=3.6 + +[options.packages.find] +where = src \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 842ca13..0000000 --- a/setup.py +++ /dev/null @@ -1,23 +0,0 @@ -import setuptools - -with open("README.md", "r") as fh: - long_description = fh.read() - -setuptools.setup( - name="CGDs", - version="0.0.3", - author="Hongkai Zheng", - author_email="devzhk@gmail.com", - description="Adaptive Competitive Gradient Descent optimizer", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/devzhk/cgds-package", - package_dir={"": "CGDs"}, - packages=setuptools.find_packages(where='CGDs'), - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - python_requires='>=3.6', -) \ No newline at end of file diff --git a/CGDs/__init__.py b/src/CGDs/__init__.py similarity index 100% rename from CGDs/__init__.py rename to src/CGDs/__init__.py diff --git a/CGDs/acgd.py b/src/CGDs/acgd.py similarity index 100% rename from CGDs/acgd.py rename to src/CGDs/acgd.py diff --git a/CGDs/cgd.py b/src/CGDs/cgd.py similarity index 100% rename from CGDs/cgd.py rename to src/CGDs/cgd.py diff --git a/CGDs/cgd_utils.py b/src/CGDs/cgd_utils.py similarity index 100% rename from CGDs/cgd_utils.py rename to src/CGDs/cgd_utils.py