Skip to content

Commit 70fca1b

Browse files
committed
isort
1 parent c418898 commit 70fca1b

File tree

5 files changed

+20
-57
lines changed

5 files changed

+20
-57
lines changed

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
torch>=1.3
2-
matplotlib>=3.3.3
2+
matplotlib>=3.1.3

setup.py

+9-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
11
#!/usr/bin/env python
2-
# Copyright The GeoML Team
3-
#
4-
# Licensed under the Apache License, Version 2.0 (the "License");
5-
# you may not use this file except in compliance with the License.
6-
# You may obtain a copy of the License at
7-
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
152
import os
163
from io import open
174

18-
from setuptools import setup, find_packages, Command
5+
from setuptools import Command, find_packages, setup
196

207
try:
218
import builtins
229
except ImportError:
2310
import __builtin__ as builtins
2411

2512
PATH_ROOT = os.path.dirname(__file__)
26-
builtins.__STOCHMAN_SETUP__ = True
13+
builtins.__TORCHPLOT_SETUP__ = True
2714

2815
import torchplot
2916

@@ -43,28 +30,27 @@ def run(self):
4330
os.system("rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info")
4431

4532

46-
PATH_ROOT = os.path.dirname(__file__)
33+
with open("README.md", encoding="utf-8") as f:
34+
long_description = f.read()
4735

4836

49-
def load_readme(path_dir=PATH_ROOT):
50-
with open(os.path.join(path_dir, "README.md"), encoding="utf-8") as f:
51-
long_description = f.read()
52-
return long_description
37+
with open("requirements.txt", "r") as reqs:
38+
requirements = reqs.read().split()
5339

5440

5541
setup(
5642
name="torchplot",
5743
version=torchplot.__version__,
5844
description=torchplot.__docs__,
59-
long_description=load_readme(PATH_ROOT),
45+
long_description=long_description,
6046
long_description_content_type="text/markdown",
6147
author=torchplot.__author__,
6248
author_email=torchplot.__author_email__,
6349
license=torchplot.__license__,
6450
packages=find_packages(exclude=["tests", "tests/*"]),
6551
python_requires=">=3",
66-
install_requires=["torch", "matplotlib"],
67-
download_url="https://github.com/CenterBioML/torchplot/archive/0.1.4.zip",
52+
install_requires=requirements,
53+
download_url="https://github.com/CenterBioML/torchplot/archive/0.1.5.zip",
6854
classifiers=[
6955
"Environment :: Console",
7056
"Natural Language :: English",

tests/test_torchplot.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
import pytest
15-
from inspect import getmembers, isfunction
16-
from collections import namedtuple
1714
import string
15+
from collections import namedtuple
16+
from inspect import getmembers, isfunction
1817

19-
import torch
18+
import matplotlib.pyplot as plt
2019
import numpy as np
20+
import pytest
21+
import torch
2122

22-
import matplotlib.pyplot as plt
2323
import torchplot as tp
2424

2525
Inputs = namedtuple("case", ["x", "y"])

torchplot/__init__.py

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
1-
# Copyright The GeoML Team
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
1+
#!/usr/bin/env python
142
"""Root package info."""
153
import os
164
import time
175

186
_this_year = time.strftime("%Y")
19-
__version__ = "0.1.4"
7+
__version__ = "0.1.5"
208
__author__ = "Nicki Skafte Detlefsen et al."
219
__author_email__ = "[email protected]"
2210
__license__ = "Apache-2.0"

torchplot/core.py

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
#!/usr/bin/env python
2-
# Copyright The GeoML Team
3-
#
4-
# Licensed under the Apache License, Version 2.0 (the "License");
5-
# you may not use this file except in compliance with the License.
6-
# You may obtain a copy of the License at
7-
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
2+
from inspect import getdoc, getmembers, isfunction
3+
154
import matplotlib.pyplot as plt
165
import torch
17-
from inspect import getmembers, isfunction, getdoc
6+
187

198
# Function to convert a list of arguments containing torch tensors, into
209
# a corresponding list of arguments containing numpy arrays

0 commit comments

Comments
 (0)