Skip to content

Commit

Permalink
wip moving to python3.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
meihuisu committed Jul 3, 2024
1 parent 6b556b9 commit 2eb56a4
Show file tree
Hide file tree
Showing 37 changed files with 67 additions and 148 deletions.
Binary file modified dist/ucvm_plotting-0.0.4.tar.gz
Binary file not shown.
11 changes: 7 additions & 4 deletions make-dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
### this are steps to build the dist of ucvm_plotting
### to install ==>>> pip install dist/ucvm_plotting-0.0.4.tar.gz

### to install ==>>> pip install dist/ucvm_plotting-0.0.5.tar.gz

#rm -rf dist build
#mkdir dist
#
# using build from https://pypi.org/project/build/
#
# base on configuration files : setup.cfg and setup.py

pip install pep517
python -m pep517.build .
pip install build
python -m build .
4 changes: 2 additions & 2 deletions pycvm/basin_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# inherits from @link horizontal_slice.HorizontalSlice @endlink.

# Imports
from horizontal_slice import HorizontalSlice
from common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .horizontal_slice import HorizontalSlice
from .common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, np, plt
##
# @class BasinSlice
Expand Down
22 changes: 11 additions & 11 deletions pycvm/common.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -583,22 +583,22 @@ def query(self, point_list, cvm, elevation = None):
if( elevation ) :
if self.z_range != None :
if self.floors != None:
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "ge", "-z", self.z_range, "-L", self.floors], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "ge", "-z", self.z_range, "-L", self.floors], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')
else:
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "ge", "-z", self.z_range], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "ge", "-z", self.z_range], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')
else :
if self.floors != None: ## z range is using default
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "ge", "-L", self.floors], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "ge", "-L", self.floors], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')
else:
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "ge"], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "ge"], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')
else :
if self.z_range != None :
if self.floors != None :
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "gd", "-z", self.z_range, "-L", self.floors], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "gd", "-z", self.z_range, "-L", self.floors], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')
else:
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "gd", "-z", self.z_range], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "gd", "-z", self.z_range], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')
else:
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "gd" ], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm, "-c", "gd" ], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')

text_points = ""

Expand Down Expand Up @@ -676,7 +676,7 @@ def poissonComplex(self, vs, vp) :
# @return An array of floats which correspond to the points provided.
def vs30(self, point_list, cvm):

proc = Popen([self.binary_dir + "/vs30_query", "-f", self.config, "-m", cvm], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.binary_dir + "/vs30_query", "-f", self.config, "-m", cvm], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')

text_points = ""
floats = []
Expand Down Expand Up @@ -720,7 +720,7 @@ def vs30(self, point_list, cvm):
def basin_depth(self, point_list, cvm, vs_threshold):

proc = Popen([self.binary_dir + "/basin_query", "-f", self.config, "-m", \
cvm, "-v", "%.0f" % vs_threshold], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
cvm, "-v", "%.0f" % vs_threshold], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')

text_points = ""
floats = []
Expand Down Expand Up @@ -817,7 +817,7 @@ def map_grid(self, point_list, cvm):
#obj = ctypes.cdll.LoadLibrary(shared_object)
#print(obj)

proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')

text_points = ""

Expand Down Expand Up @@ -856,7 +856,7 @@ def map_grid(self, point_list, cvm):
def vs30_etree(self, point_list, cvm):
properties = []

proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
proc = Popen([self.utility_dir + "/run_ucvm_query.sh", "-f", self.config, "-m", cvm], stdout=PIPE, stdin=PIPE, stderr=STDOUT, encoding='utf8')

text_points = ""

Expand Down
4 changes: 2 additions & 2 deletions pycvm/cross_difference_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# @version
#
# Imports
from cross_section import CrossSection
from common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .cross_section import CrossSection
from .common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, basemap, np, plt

##
Expand Down
2 changes: 1 addition & 1 deletion pycvm/cross_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#XXX from mpl_toolkits.basemap import cm
from matplotlib import cm

from common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, np, plt

import random
Expand Down
2 changes: 1 addition & 1 deletion pycvm/cybershake.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# questions like: what are the Vs30 values for all CyberShake sites, or
# what are the basin depths for precarious rock sites?

from common import Point
from .common import Point

##
# @class CyberShake
Expand Down
8 changes: 4 additions & 4 deletions pycvm/depth_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
# arguments, or through Python code in the class DepthProfile.

# Imports
from common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, plt
from scipy.interpolate import spline, splprep, splev
from scipy.interpolate import Rbf, InterpolatedUnivariateSpline
import scipy.interpolate as interpolate
from .common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, plt
##from scipy.interpolate import spline, splprep, splev
##from scipy.interpolate import Rbf, InterpolatedUnivariateSpline
##import scipy.interpolate as interpolate
import numpy as np
import json

Expand Down
2 changes: 1 addition & 1 deletion pycvm/difference.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Imports
from mpl_toolkits import basemap
from mpl_toolkits.basemap import cm
from common import MaterialProperties, Plot, cm, np, basemap, plt
from .common import MaterialProperties, Plot, cm, np, basemap, plt

##
# @class Difference
Expand Down
2 changes: 1 addition & 1 deletion pycvm/elevation_cross_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Imports
from mpl_toolkits import basemap
from mpl_toolkits.basemap import cm
from common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, basemap, np, plt

import random
Expand Down
4 changes: 2 additions & 2 deletions pycvm/elevation_horizontal_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Imports
from mpl_toolkits import basemap
from mpl_toolkits.basemap import cm
from common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, basemap, np, plt

##
Expand Down Expand Up @@ -151,7 +151,7 @@ def getplotvals(self, mproperty="vs"):
data=data1d[0].tolist()
print("\nUsing --> "+self.datafile)

else:
else:
# Generate a list of points to pass to UCVM.
ucvmpoints = []
for y in xrange(0, self.num_y):
Expand Down
8 changes: 4 additions & 4 deletions pycvm/elevation_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
# arguments, or through Python code in the class ElevationProfile.

# Imports
from common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, plt
from scipy.interpolate import spline, splprep, splev
from scipy.interpolate import Rbf, InterpolatedUnivariateSpline
import scipy.interpolate as interpolate
from .common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, plt
##from scipy.interpolate import spline, splprep, splev
##from scipy.interpolate import Rbf, InterpolatedUnivariateSpline
##import scipy.interpolate as interpolate
import numpy as np
import json

Expand Down
4 changes: 2 additions & 2 deletions pycvm/elevation_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# @link horizontal_slice.HorizontalSlice HorizontalSlice @endlink.

# Imports
from horizontal_slice import HorizontalSlice
from common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .horizontal_slice import HorizontalSlice
from .common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, basemap, np, plt

##
Expand Down
4 changes: 2 additions & 2 deletions pycvm/horizontal_difference_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# @version
#
# Imports
from horizontal_slice import HorizontalSlice
from common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .horizontal_slice import HorizontalSlice
from .common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, basemap, np, plt

##
Expand Down
2 changes: 1 addition & 1 deletion pycvm/horizontal_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Imports
from mpl_toolkits import basemap
from mpl_toolkits.basemap import cm
from common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .common import Plot, Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, basemap, np, plt

##
Expand Down
4 changes: 2 additions & 2 deletions pycvm/map_grid_horizontal_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# @link horizontal_slice.HorizontalSlice HorizontalSlice @endlink.
#
# Imports
from horizontal_slice import HorizontalSlice
from common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .horizontal_slice import HorizontalSlice
from .common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, basemap, np, plt

##
Expand Down
Empty file modified pycvm/nafe_drake.py
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions pycvm/vs30_etree_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# @link horizontal_slice.HorizontalSlice HorizontalSlice @endlink.

# Imports
from horizontal_slice import HorizontalSlice
from common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .horizontal_slice import HorizontalSlice
from .common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, basemap, np, plt

##
Expand Down
4 changes: 2 additions & 2 deletions pycvm/vs30_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# @link horizontal_slice.HorizontalSlice HorizontalSlice @endlink.

# Imports
from horizontal_slice import HorizontalSlice
from common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
from .horizontal_slice import HorizontalSlice
from .common import Point, MaterialProperties, UCVM, UCVM_CVMS, \
math, pycvm_cmapDiscretize, cm, mcolors, basemap, np, plt

##
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[metadata]
name = pycvm
version = 0.0.4
version = 0.0.5

[options]
packages = pycvm
install_requires =
requests
importlib; python_version == "2.7"
importlib; python_version == "3.11.0"


4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
with open("README.md") as f:
LONG_DESCRIPTION = "".join(f.readlines())

VERSION = "0.0.4"
VERSION = "0.0.5"

CLASSIFIERS = [
"Development Status :: 1 - Alpha",
Expand All @@ -30,7 +30,7 @@
"Intended Audience :: Education",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.11.0",
"License :: OSI Approved :: {}".format(LICENSE),
]
PLATFORMS = "Any"
Expand Down
84 changes: 0 additions & 84 deletions ucvmPlotting.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ucvm_plotting/make_map_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def usage():
exit(0)
elif len(ret_val) > 0:
print("Using parameters:\n")
for key, value in ret_val.iteritems():
for key, value in ret_val.items():
print(key +" = "+ value)
meta[key]=value
try:
Expand Down
2 changes: 1 addition & 1 deletion ucvm_plotting/plot_cross_difference_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def usage():
exit(0)
elif len(ret_val) > 0:
print("Using parameters:\n")
for key, value in ret_val.iteritems():
for key, value in ret_val.items():
print(key +" = "+ value)
meta[key] = value
try:
Expand Down
2 changes: 1 addition & 1 deletion ucvm_plotting/plot_cross_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def usage():
exit(0)
elif len(ret_val) > 0:
print("Using parameters:\n")
for key, value in ret_val.iteritems():
for key, value in ret_val.items():
print(key +" = "+ value)
meta[key] = value
try:
Expand Down
Loading

0 comments on commit 2eb56a4

Please sign in to comment.