From 7cc2fe087f160fa468cb94f0eba7ea523ea54725 Mon Sep 17 00:00:00 2001 From: Minjie Zhu Date: Wed, 6 Nov 2019 14:22:12 -0800 Subject: [PATCH] version 0.5.4 --- .gitignore | 3 ++- README.md | 20 +++++++++++++++++ README.rst | 8 ------- openseespy/{LICENSE.rst => LICENSE.md} | 3 +-- openseespy/opensees/__init__.py | 8 +++++-- .../opensees/{linux/lib => mac}/__init__.py | 0 openseespy/opensees/mac/libs/__init__.py | 1 + openseespy/opensees/winpy38/__init__.py | 0 openseespy/postprocessing/__init__.py | 0 openseespy/postprocessing/model.py | 22 +++++++++++++++++++ openseespy/version.py | 2 +- requirements.txt | 2 ++ setup.py | 15 ++++++++----- 13 files changed, 65 insertions(+), 19 deletions(-) create mode 100644 README.md delete mode 100644 README.rst rename openseespy/{LICENSE.rst => LICENSE.md} (99%) rename openseespy/opensees/{linux/lib => mac}/__init__.py (100%) create mode 100644 openseespy/opensees/mac/libs/__init__.py create mode 100644 openseespy/opensees/winpy38/__init__.py create mode 100644 openseespy/postprocessing/__init__.py create mode 100644 openseespy/postprocessing/model.py diff --git a/.gitignore b/.gitignore index 369971179..59ca9183b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ dist *.pyd *.dll *.so.* -.idea \ No newline at end of file +.idea +*.dylib diff --git a/README.md b/README.md new file mode 100644 index 000000000..f78adbf4b --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# OpenSeesPy + + +Pip Package for OpenSeesPy + +Linux and Windows versions maintained by: + +Minjie Zhu +Research Associate; +Civil and Construction Engineering; Oregon State University + +Mac version maintained by: + +Stevan Gavrilovic +PhD Candidate; +Structural and Earthquake Engineering; +University of British Columbia + +[OpenSeesPy Documentation](https://openseespydoc.readthedocs.io/en/latest/index.html) + diff --git a/README.rst b/README.rst deleted file mode 100644 index 654b0e8fd..000000000 --- a/README.rst +++ /dev/null @@ -1,8 +0,0 @@ -=============== - OpenSeesPy -=============== - -Pip Package for OpenSeesPy - -`OpenSeesPy Documentation `_ - diff --git a/openseespy/LICENSE.rst b/openseespy/LICENSE.md similarity index 99% rename from openseespy/LICENSE.rst rename to openseespy/LICENSE.md index 57e8d2449..a089d001f 100644 --- a/openseespy/LICENSE.rst +++ b/openseespy/LICENSE.md @@ -1,5 +1,4 @@ -LICENSE -======= +# LICENSE Copyright (c) 2012-2017, The Regents of the University of California (Regents). All rights reserved. diff --git a/openseespy/opensees/__init__.py b/openseespy/opensees/__init__.py index fcc37d026..f12fbde6e 100644 --- a/openseespy/opensees/__init__.py +++ b/openseespy/opensees/__init__.py @@ -22,13 +22,17 @@ from openseespy.opensees.winpy36.opensees import * - else: + elif sys.version_info[1] == 7: from openseespy.opensees.winpy37.opensees import * + elif sys.version_info[1] == 8: + + from openseespy.opensees.winpy38.opensees import * + elif sys.platform.startswith('darwin'): - raise RuntimeError('Mac OS X is not supported yet') + from openseespy.opensees.mac.opensees import * else: diff --git a/openseespy/opensees/linux/lib/__init__.py b/openseespy/opensees/mac/__init__.py similarity index 100% rename from openseespy/opensees/linux/lib/__init__.py rename to openseespy/opensees/mac/__init__.py diff --git a/openseespy/opensees/mac/libs/__init__.py b/openseespy/opensees/mac/libs/__init__.py new file mode 100644 index 000000000..c87b70731 --- /dev/null +++ b/openseespy/opensees/mac/libs/__init__.py @@ -0,0 +1 @@ +name = "openseespymac" diff --git a/openseespy/opensees/winpy38/__init__.py b/openseespy/opensees/winpy38/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/openseespy/postprocessing/__init__.py b/openseespy/postprocessing/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/openseespy/postprocessing/model.py b/openseespy/postprocessing/model.py new file mode 100644 index 000000000..8cbd11f5e --- /dev/null +++ b/openseespy/postprocessing/model.py @@ -0,0 +1,22 @@ +import openseespy.opensees as ops +import matplotlib.pyplot as plt + + +def drawModel(): + plt.figure() + + etags = ops.getEleTags() + if etags is None: + return + if isinstance(etags, int): + etags = [etags] + + for e in etags: + elenodes = ops.eleNodes(e) + for i in range(0, len(elenodes)): + + [xi, yi] = ops.nodeCoord(elenodes[i-1]) + [xj, yj] = ops.nodeCoord(elenodes[i]) + plt.plot([xi, xj], [yi, yj], 'k') + + plt.show() diff --git a/openseespy/version.py b/openseespy/version.py index d1ace02b5..35e85607c 100644 --- a/openseespy/version.py +++ b/openseespy/version.py @@ -1 +1 @@ -version = "0.4.2019.7" \ No newline at end of file +version = "0.5.4" diff --git a/requirements.txt b/requirements.txt index e079f8a60..919541993 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ pytest +matplotlib +numpy \ No newline at end of file diff --git a/setup.py b/setup.py index 1f4362250..202f62863 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ with open('openseespy/version.py') as fp: exec(fp.read(), about) -with open("README.rst", "r") as fh: +with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( @@ -14,25 +14,30 @@ author_email="zhum@oregonstate.edu", description="A OpenSeesPy package", long_description=long_description, + long_description_content_type="text/markdown", url="https://github.com/openseespy/openseespy", packages=setuptools.find_packages(), package_data={ '': [ 'opensees.so', 'opensees.pyd', - 'LICENSE.rst', + 'LICENSE.md', '*.so', '*.dll', + '*.dylib', '*.so.*'], }, - license='LICENSE.rst', + license='LICENSE.md', classifiers=[ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", 'Operating System :: POSIX :: Linux', - 'Operating System :: Microsoft :: Windows'], + 'Operating System :: Microsoft :: Windows', + "Operating System :: MacOS :: MacOS X"], platforms=[ "Linux", - 'Windows'], + 'Windows', + 'Mac'], python_requires='>=3.6', zip_safe=False)