Giter Club home page Giter Club logo

pystrata's People

Contributors

arkottke avatar millen1m avatar stickler-ci avatar subsurfaceiodev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pystrata's Issues

Menq dynamic curve IMPORTANT ISSUE

_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)

The maximum shear strain profile estimated in MaxStrainProfile is returning Array of strain values for a layer

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...

Pip installer is broken

    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'

Error in executing randomization of modulus reduction and damping ratio curves

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_freqs
2) * 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

  • self._waves_b[lout.index, :] * np.exp(-cterm)
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:448: RuntimeWarning: overflow encountered in multiply
    1j
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:461: RuntimeWarning: invalid value encountered in multiply
    tf[mask] = GRAVITY * numer[mask] / denom[mask]
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:327: RuntimeWarning: overflow encountered in exp
    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 exp
    waves_b[i + 1, :] = 0.5 * waves_a[i] * (1 - cimped) * np.exp(
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:448: RuntimeWarning: invalid value encountered in multiply
    1j
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:451: RuntimeWarning: invalid value encountered in subtract
    self._waves_a[lout.index, :] * np.exp(cterm)
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:451: RuntimeWarning: overflow encountered in subtract
    self._waves_a[lout.index, :] * np.exp(cterm)
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:309: RuntimeWarning: divide by zero encountered in divide
    wave_nums[i, :] = angular_freqs / l.comp_shear_vel
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:362: RuntimeWarning: invalid value encountered in multiply
    cterm = 1j * self._wave_nums[l.index] * l.depth_within
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\site.py:804: RuntimeWarning: divide by zero encountered in double_scalars
    err = 100.0 * np.max((self.previous - self.value) / self.value)
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:387: RuntimeWarning: invalid value encountered in divide
    tf = self.wave_at_location(lout) / self.wave_at_location(lin)
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:561: RuntimeWarning: divide by zero encountered in double_scalars
    l.strain = self._motion.pgv / l.initial_shear_vel
    C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\site.py:804: RuntimeWarning: invalid value encountered in double_scalars
    err = 100.0 * np.max((self.previous - self.value) / self.value)

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.

PreviousVersion
LatestVersion

Installation issues

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

Maximum recursion depth exceeded while calling a Python object

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).

No module named 'pyrvt'

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'`

Error in executing example 6

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.

Issue with cyko package not building on install

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.