iam-git / WellMet (public) (License: MIT) (since 2021-08-31) (hash sha1)
WellMet is pure Python framework for spatial structural reliability analysis. Or, more specifically, for "failure probability estimation and detection of failure surfaces by adaptive sequential decomposition of the design domain".

/gp_plot.py (5d721d117448dbb96c554ea8f0e4651ffe9ac457) (2718 bytes) (mode 100644) (type blob)

#!/usr/bin/env python
# coding: utf-8

import PyGnuplot as gp
import os

# nikdo mi neuvěří, že by tohle postačílo a nebylo by nutné tohlensto furt úpravovat
def gp_plot(sample_box, space='R', terminal='png', filename=''):
    if not filename:
        filename = 'store/%s_%s_%s'%(sample_box.gm_signature, space, sample_box.nsim)
    if space in ['Rn', 'GK', 'G']:
        gp.c('set autoscale xy')
        gp.c('set size square')
        gp.c('set zeroaxis')
    elif space in ['P', 'U']:
        gp.c('set xrange [0:1]')
        gp.c('set yrange [0:1]')
        gp.c('set size square')
        #gp.c('set autoscale')
        gp.c('unset zeroaxis')
    else: # R teda?
        gp.c('set size noratio')
        gp.c('set autoscale')
        gp.c('unset zeroaxis')
        
    gp.c('set terminal ' + terminal)
    gp.c('set output "%s.%s"'%(filename, terminal))
    if os.name == 'posix':
        gp.c('set decimalsign locale "POSIX"')
    
    # legenda
    gp.c('unset key')
    
    # se mi zda, že gp bere data v řadcích
    f_name = "%s_failure.dat" % (filename)
    s_name = "%s_success.dat" % (filename)
    gp.s(getattr(sample_box.failure_samples, space).T, f_name)
    gp.s(getattr(sample_box.success_samples, space).T, s_name)
    
    
    # rozkaz, který předaváme gnuplotovi
    gp_plot = 'plot "%s" title "Success points" w p lc rgb "green", "%s" title "Failure points" w p lc rgb "red"' % (s_name, f_name)
    
    # Kružničky chcete?
    # Кружочки ннада?
    if space in ['Rn', 'G']:
        gp.c('set parametric')
        for i in range(5):
            lw = 2 - i*0.3
            gp_plot += ', cos(t)*%s,sin(t)*%s notitle w l lc rgb "black" lw %s'%(i+1, i+1, lw)
            
    # ne všichni majó definované hranice
    try:
        bounds = sample_box.get_2D_boundary()
    
        for i in range(len(bounds)):
            bound = getattr(bounds[i], space).T 
            gp.s(bound, "%s_boundary_%s.dat"%(filename, i+1))
            gp_plot += ', "%s_boundary_%s.dat" notitle w l lc rgb "blue"'%(filename, i+1)
    except AttributeError:
        pass
    
    # Plot!
    gp.c(gp_plot)



# nikdo mi neuvěří, že by tohle postačílo a nebylo by nutné tohlensto furt úpravovat
def plot(data2D, terminal='png', filename=''):
    if not filename:
        filename = 'store/plot_%s'%(len(data2D[0]))
        
    gp.c('set terminal ' + terminal)
    gp.c('set output "%s.%s"'%(filename, terminal))
    if os.name == 'posix':
        gp.c('set decimalsign locale "POSIX"')
    
    
    # se mi zda, že gp bere data v řadcích
    gp.s(data2D, filename+'.dat')
    
    # Plot!
    # rozkaz, který předaváme gnuplotovi
    gp.c('plot "%s.dat" ' % (filename))


Mode Type Size Ref File
100644 blob 28117 0907e38499eeca10471c7d104d4b4db30b8b7084 IS_stat.py
100644 blob 6 0916b75b752887809bac2330f3de246c42c245cd __init__.py
100644 blob 72 458b7e2ca46acd9ec0d2caf3cc4d72e515bb73dc __main__.py
100644 blob 73368 3d245b8568158ac63c80fa0847631776a140db0f blackbox.py
100644 blob 11243 10c424c2ce5e8cdd0da97a5aba74c54d1ca71e0d candybox.py
100644 blob 29927 066a2d10ea1d21daa6feb79fa067e87941299ec4 convex_hull.py
100644 blob 102798 059ae717e71c651975673420cd8230fbef171e5e dicebox.py
100644 blob 36930 a775d1114bc205bbd1da0a10879297283cca0d4c estimation.py
100644 blob 34394 3f0ab9294a9352a071de18553aa687c2a9e6917a f_models.py
100644 blob 34297 a0b9c09553992a3b70a728d1e1c757ef7d9df550 g_models.py
100644 blob 20908 457329fe567f1c0a9950c21c7c494cccf38193cc ghull.py
100644 blob 2718 5d721d117448dbb96c554ea8f0e4651ffe9ac457 gp_plot.py
100644 blob 29393 96162a5d181b8307507ba2f44bafe984aa939163 lukiskon.py
100644 blob 2004 6ea8dc8f50a656c48f786d5a00bd6398276c9741 misc.py
040000 tree - cfd54988947c0d1763d45c7d9315c5ee59762ba2 mplot
100644 blob 1462 437b0d372b6544c74fea0d2c480bb9fd218e1854 plot.py
100644 blob 2807 1feb1d43e90e027f35bbd0a6730ab18501cef63a plotly_plot.py
040000 tree - bfb2adfd17a5c916d2a132e2607f57f14561559e qt_gui
100644 blob 8566 5c8f8cc2a34798a0f25cb9bf50b5da8e86becf64 reader.py
100644 blob 4284 a0e0b4e593204ff6254f23a67652804db07800a6 samplebox.py
100644 blob 6558 df0e88ea13c95cd1463a8ba1391e27766b95c3a5 sball.py
100644 blob 6739 0b6f1878277910356c460674c04d35abd80acf13 schemes.py
100644 blob 76 11b2fde4aa744a1bc9fa1b419bdfd29a25c4d3e8 shapeshare.py
100644 blob 54884 fbe116dab4fc19bb7568102de21f53f15a8fc6bf simplex.py
100644 blob 13090 2b9681eed730ecfadc6c61b234d2fb19db95d87d spring.py
100644 blob 10953 da8a8aaa8cac328ec0d1320e83cb802b562864e2 stm_df.py
040000 tree - 911a2861b1ce5232e828a60dd06551abd56555cc testcases
100644 blob 2465 d829bff1dd721bdb8bbbed9a53db73efac471dac welford.py
100644 blob 25318 fcdabd880bf7199783cdb9c0c0ec88c9813a5b18 whitebox.py
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/iam-git/WellMet

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/iam-git/WellMet

Clone this repository using git:
git clone git://git.rocketgit.com/user/iam-git/WellMet

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main