arkottke / pystrata Goto Github PK
View Code? Open in Web Editor NEWSite Response Analysis Toolkit for Python
License: MIT License
Site Response Analysis Toolkit for Python
License: MIT License
_calc_damping_min and _calc_strain_ref functions are using _stress_mean in kPa! This value must be converted to ATM: change _stress_mean for (_stress_mean * KPA_TO_ATM)
Dear sir,
While running a site response analysis, I came across the following problem.
Error:
The maximum shear strain profile estimated in MaxStrainProfile class for a layer is returning Array of strain values.
Possible reason:
Line 437, output.py:
values = [0] + [l.strain for l in calc.profile[:-1]]
The above line can be modified as
values = [0] + [l.strain_max for l in calc.profile[:-1]]
to obtain correct results..
Kindly confirm whether the above fix is ok...
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-owr_sa2y/pysra/setup.py", line 9, in <module>
with open('HISTORY.md') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'HISTORY.md'
Hello.
I have been using PYSTRATA for a long time and it worked very well. However, I just downloaded the latest version of PYSTRATA and Python both. During an equivalent linear analysis based on one of your examples, I executed the following command to implement the randomization of modulus reduction and damping ratio curves:
var_soiltypes = pystrata.variation.DarendeliVariation(-0.5)
count = 4
for geopsy_profile in iter_geopsy_profiles(fname):
for profile in pystrata.variation.iter_varied_profiles(
profile,
count,
var_thickness=None,
var_velocity=None,
var_soiltypes=var_soiltypes
):
calc(ts, profile, profile.location('outcrop', index=-1))
outputs(calc)
In earlier versions, it used to show only this message:
C:\Users\ADMIN\anaconda3\lib\site-packages\pystrata\site.py:741: RuntimeWarning: divide by zero encountered in divide
err = 100.0 * np.max((self.previous - self.value) / self.value)
C:\Users\ADMIN\anaconda3\lib\site-packages\pystrata\site.py:741: RuntimeWarning: invalid value encountered in divide
err = 100.0 * np.max((self.previous - self.value) / self.value)
But, it used to work well and provided the results properly.
However, with the latest version, It showed this message:
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\site.py:804: RuntimeWarning: divide by zero encountered in divide
err = 100.0 * np.max((self.previous - self.value) / self.value)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\site.py:804: RuntimeWarning: invalid value encountered in divide
err = 100.0 * np.max((self.previous - self.value) / self.value)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:327: RuntimeWarning: overflow encountered in multiply
waves_a[i + 1, :] = 0.5 * waves_a[i] * (1 + cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:327: RuntimeWarning: invalid value encountered in multiply
waves_a[i + 1, :] = 0.5 * waves_a[i] * (1 + cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:329: RuntimeWarning: overflow encountered in multiply
) + 0.5 * waves_b[i] * (1 - cimped) * np.exp(-cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:327: RuntimeWarning: invalid value encountered in add
waves_a[i + 1, :] = 0.5 * waves_a[i] * (1 + cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:330: RuntimeWarning: overflow encountered in multiply
waves_b[i + 1, :] = 0.5 * waves_a[i] * (1 - cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:330: RuntimeWarning: invalid value encountered in multiply
waves_b[i + 1, :] = 0.5 * waves_a[i] * (1 - cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:332: RuntimeWarning: overflow encountered in multiply
) + 0.5 * waves_b[i] * (1 + cimped) * np.exp(-cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:330: RuntimeWarning: invalid value encountered in add
waves_b[i + 1, :] = 0.5 * waves_a[i] * (1 - cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:369: RuntimeWarning: overflow encountered in multiply
return 2 * self._waves_a[l.index] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:369: RuntimeWarning: invalid value encountered in multiply
return 2 * self._waves_a[l.index] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:455: RuntimeWarning: overflow encountered in multiply
denom = -(ang_freqs2) * self.wave_at_location(lin)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:455: RuntimeWarning: invalid value encountered in multiply
denom = -(ang_freqs2) * self.wave_at_location(lin)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:461: RuntimeWarning: invalid value encountered in divide
tf[mask] = GRAVITY * numer[mask] / denom[mask]
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:461: RuntimeWarning: overflow encountered in multiply
tf[mask] = GRAVITY * numer[mask] / denom[mask]
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:309: RuntimeWarning: invalid value encountered in divide
wave_nums[i, :] = angular_freqs / l.comp_shear_vel
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:329: RuntimeWarning: invalid value encountered in multiply
) + 0.5 * waves_b[i] * (1 - cimped) * np.exp(-cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:332: RuntimeWarning: invalid value encountered in multiply
) + 0.5 * waves_b[i] * (1 + cimped) * np.exp(-cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:451: RuntimeWarning: overflow encountered in multiply
self._waves_a[lout.index, :] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:451: RuntimeWarning: invalid value encountered in multiply
self._waves_a[lout.index, :] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:452: RuntimeWarning: invalid value encountered in multiply
After that, it generated results, but in the output, the majority of the values are shown as 'NaN' and therefore, in the plots also, very few output curves are shown (Figure attached(Previous version and current)). I request you to kindly let me know how to rectify this error.
It seems to run twice! The first with correct values but the second (unnecessary) time with incorrect input values (like self._stress_mean = None)
Installing pystrata on my various machines has resulted in several issues. The most common one is that it says pyexcel is needed when importing pystrata.
This is what I've found to be the most successful way of installing pystrata
conda create --name pystrata python=3.9 spyder-kernels=2.1.0 pandas pyexcel
pip install pystrata
This allows pystrata to be successfully imported, but when launching spyder in the environment there are a handful of matplotlib warnings that can be solved by also running this in the environment
pip3 install PyQt5
I noticed this error occurring in python 3.7 but not in python 3.6. The error occurs when all the soil layers are added (i.e., when I execute this: "pysra.site.Profile(layers)"). Below is some information on where this error occurs.
File "/home1/04482/marafi/anaconda3/lib/python3.7/site-packages/pysra/site.py", line 833, in init
self.update_layers()
File "/home1/04482/marafi/anaconda3/lib/python3.7/site-packages/pysra/site.py", line 845, in update_layers
for layer in self[start_layer:]:
File "/home1/04482/marafi/anaconda3/lib/python3.7/collections/init.py", line 1096, in getitem
return self.class(self.data[i])
RecursionError: maximum recursion depth exceeded while calling a Python object
self.update_layers()
Let me know if you need more information. If you are unable to recreate this error, try using a large number of soil layers (>100).
Hello, I just installled pystrata and when running the first example as a jupyter threw teh following error, suggesting the pyrvt module is missing. I installed all the dependencies listed (cmake, qt, gsl, qwt, and fftw). How can I fix this?
`import matplotlib.pyplot as plt
import numpy as np
import pystrata
%matplotlib inline
ModuleNotFoundError Traceback (most recent call last)
Cell In[7], line 4
1 import matplotlib.pyplot as plt
2 import numpy as np
----> 4 import pystrata
6 get_ipython().run_line_magic('matplotlib', 'inline')
File ~\Anaconda3\envs\pystrata\Lib\site-packages\pystrata_init_.py:23
1 # -- coding: utf-8 --
2 # The MIT License (MIT)
3 #
(...)
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 # SOFTWARE.
---> 23 from . import motion
24 from . import output
25 from . import propagation
File ~\Anaconda3\envs\pystrata\Lib\site-packages\pystrata\motion.py:27
24 import re
26 import numpy as np
---> 27 import pyrvt
28 from scipy.constants import g as GRAVITY
30 # Gravity in m/sec²
ModuleNotFoundError: No module named 'pyrvt'`
In the manifest file please change:
include HISTORY.rst
include README.rst
to:
include HISTORY.md
include README.md
I got this error while running the example 6 given in PYSRA:
Traceback (most recent call last):
File "", line 1, in
File "", line 20, in iter_geopsy_profiles
File "", line 20, in
NameError: name 'floa4t' is not defined
It was shown when executing this command:
fname = 'data/best100_GM_linux.txt'
for geopsy_profile in iter_geopsy_profiles(fname):
profile = pysra.site.Profile([
pysra.site.Layer(
pysra.site.SoilType(
'soil-%d' % i, l['density'] / pysra.site.GRAVITY,
damping=0.05), l['thickness'], l['vel_shear'])
for i, l in enumerate(geopsy_profile['layers'])
])
# Use 1% damping for the half-space
profile[-1].soil_type.damping = 0.01
# Compute the waves from the last layer
calc(ts, profile, profile.location('outcrop', index=-1))
# Compute the site amplification
outputs(calc)
The above was while running in python.
While running in Jupyter notebook, below error was shown:
TypeError Traceback (most recent call last)
in
18 pysra.output.OutputLocation('outcrop', index=0),
19 # Damping
---> 20 0.05
21 ),
22
TypeError: init() takes 2 positional arguments but 3 were given
This was while executing the commands given in In[12] in the example 6.
New packages are not in the install requires list on setup.py. Causes build failure.
I am trying to install pysra from requirements.txt it doesn't build unless I first manually install Cython.
See error message below:
Collecting cyko (from pySRA->-r requirements.txt (line 8))
Downloading https://files.pythonhosted.org/packages/06/10/7401c797e805c04ddce76aec75ee100c4894fe97b3c5af078f678a4fdcd5/cyko-0.2.5.2.tar.gz (54kB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-a64yu20q/cyko/setup.py", line 3, in
from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.