diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/advanced-usage.rst b/docs/advanced-usage.rst new file mode 100644 index 0000000..c15ef62 --- /dev/null +++ b/docs/advanced-usage.rst @@ -0,0 +1,18 @@ +Advanced usage +============== + +.. currentmodule:: pyrvt.peak_calculators + +.. autosummary:: + :toctree: generated/ + + Vanmarcke1975 + Davenport1964 + DerKiureghian1985 + ToroMcGuire1987 + CartwrightLonguetHiggins1956 + BooreJoyner1984 + LiuPezeshk1999 + BooreThompson2012 + BooreThompson2015 + WangRathje2018 diff --git a/docs/authors.md b/docs/authors.md new file mode 100644 index 0000000..786b75d --- /dev/null +++ b/docs/authors.md @@ -0,0 +1 @@ +--8<-- "CHANGELOG.md" diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 0000000..786b75d --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1 @@ +--8<-- "CHANGELOG.md" diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100644 index 0000000..ea38c9b --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1 @@ +--8<-- "CONTRIBUTING.md" diff --git a/docs/coverage.md b/docs/coverage.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/credits.md b/docs/credits.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/generated/pyrvt.peak_calculators.BooreJoyner1984.rst b/docs/generated/pyrvt.peak_calculators.BooreJoyner1984.rst new file mode 100644 index 0000000..dcff732 --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.BooreJoyner1984.rst @@ -0,0 +1,33 @@ +pyrvt.peak\_calculators.BooreJoyner1984 +======================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: BooreJoyner1984 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~BooreJoyner1984.__init__ + ~BooreJoyner1984.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~BooreJoyner1984.ABBREV + ~BooreJoyner1984.NAME + ~BooreJoyner1984.abbrev + ~BooreJoyner1984.min_zero_crossings + ~BooreJoyner1984.name + + \ No newline at end of file diff --git a/docs/generated/pyrvt.peak_calculators.BooreThompson2012.rst b/docs/generated/pyrvt.peak_calculators.BooreThompson2012.rst new file mode 100644 index 0000000..c3b1f75 --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.BooreThompson2012.rst @@ -0,0 +1,33 @@ +pyrvt.peak\_calculators.BooreThompson2012 +========================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: BooreThompson2012 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~BooreThompson2012.__init__ + ~BooreThompson2012.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~BooreThompson2012.ABBREV + ~BooreThompson2012.NAME + ~BooreThompson2012.abbrev + ~BooreThompson2012.min_zero_crossings + ~BooreThompson2012.name + + \ No newline at end of file diff --git a/docs/generated/pyrvt.peak_calculators.BooreThompson2015.rst b/docs/generated/pyrvt.peak_calculators.BooreThompson2015.rst new file mode 100644 index 0000000..792f1c5 --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.BooreThompson2015.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.BooreThompson2015 +========================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: BooreThompson2015 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~BooreThompson2015.__init__ + ~BooreThompson2015.limited_num_zero_crossings + ~BooreThompson2015.nonstationarity_factor + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~BooreThompson2015.ABBREV + ~BooreThompson2015.NAME + ~BooreThompson2015.abbrev + ~BooreThompson2015.min_zero_crossings + ~BooreThompson2015.name + + \ No newline at end of file diff --git a/docs/generated/pyrvt.peak_calculators.CartwrightLonguetHiggins1956.rst b/docs/generated/pyrvt.peak_calculators.CartwrightLonguetHiggins1956.rst new file mode 100644 index 0000000..11743a5 --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.CartwrightLonguetHiggins1956.rst @@ -0,0 +1,33 @@ +pyrvt.peak\_calculators.CartwrightLonguetHiggins1956 +==================================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: CartwrightLonguetHiggins1956 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~CartwrightLonguetHiggins1956.__init__ + ~CartwrightLonguetHiggins1956.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~CartwrightLonguetHiggins1956.ABBREV + ~CartwrightLonguetHiggins1956.NAME + ~CartwrightLonguetHiggins1956.abbrev + ~CartwrightLonguetHiggins1956.min_zero_crossings + ~CartwrightLonguetHiggins1956.name + + \ No newline at end of file diff --git a/docs/generated/pyrvt.peak_calculators.Davenport1964.rst b/docs/generated/pyrvt.peak_calculators.Davenport1964.rst new file mode 100644 index 0000000..110079a --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.Davenport1964.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.Davenport1964 +===================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: Davenport1964 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Davenport1964.__init__ + ~Davenport1964.asymtotic_approx + ~Davenport1964.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Davenport1964.ABBREV + ~Davenport1964.NAME + ~Davenport1964.abbrev + ~Davenport1964.min_zero_crossings + ~Davenport1964.name + + \ No newline at end of file diff --git a/docs/generated/pyrvt.peak_calculators.DerKiureghian1985.rst b/docs/generated/pyrvt.peak_calculators.DerKiureghian1985.rst new file mode 100644 index 0000000..a895611 --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.DerKiureghian1985.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.DerKiureghian1985 +========================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: DerKiureghian1985 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~DerKiureghian1985.__init__ + ~DerKiureghian1985.asymtotic_approx + ~DerKiureghian1985.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DerKiureghian1985.ABBREV + ~DerKiureghian1985.NAME + ~DerKiureghian1985.abbrev + ~DerKiureghian1985.min_zero_crossings + ~DerKiureghian1985.name + + \ No newline at end of file diff --git a/docs/generated/pyrvt.peak_calculators.LiuPezeshk1999.rst b/docs/generated/pyrvt.peak_calculators.LiuPezeshk1999.rst new file mode 100644 index 0000000..fc05736 --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.LiuPezeshk1999.rst @@ -0,0 +1,33 @@ +pyrvt.peak\_calculators.LiuPezeshk1999 +====================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: LiuPezeshk1999 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~LiuPezeshk1999.__init__ + ~LiuPezeshk1999.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~LiuPezeshk1999.ABBREV + ~LiuPezeshk1999.NAME + ~LiuPezeshk1999.abbrev + ~LiuPezeshk1999.min_zero_crossings + ~LiuPezeshk1999.name + + \ No newline at end of file diff --git a/docs/generated/pyrvt.peak_calculators.ToroMcGuire1987.rst b/docs/generated/pyrvt.peak_calculators.ToroMcGuire1987.rst new file mode 100644 index 0000000..861757f --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.ToroMcGuire1987.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.ToroMcGuire1987 +======================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: ToroMcGuire1987 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~ToroMcGuire1987.__init__ + ~ToroMcGuire1987.asymtotic_approx + ~ToroMcGuire1987.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ToroMcGuire1987.ABBREV + ~ToroMcGuire1987.NAME + ~ToroMcGuire1987.abbrev + ~ToroMcGuire1987.min_zero_crossings + ~ToroMcGuire1987.name + + \ No newline at end of file diff --git a/docs/generated/pyrvt.peak_calculators.Vanmarcke1975.rst b/docs/generated/pyrvt.peak_calculators.Vanmarcke1975.rst new file mode 100644 index 0000000..f544ac4 --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.Vanmarcke1975.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.Vanmarcke1975 +===================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: Vanmarcke1975 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Vanmarcke1975.__init__ + ~Vanmarcke1975.limited_num_zero_crossings + ~Vanmarcke1975.nonstationarity_factor + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Vanmarcke1975.ABBREV + ~Vanmarcke1975.NAME + ~Vanmarcke1975.abbrev + ~Vanmarcke1975.min_zero_crossings + ~Vanmarcke1975.name + + \ No newline at end of file diff --git a/docs/generated/pyrvt.peak_calculators.WangRathje2018.rst b/docs/generated/pyrvt.peak_calculators.WangRathje2018.rst new file mode 100644 index 0000000..ee924af --- /dev/null +++ b/docs/generated/pyrvt.peak_calculators.WangRathje2018.rst @@ -0,0 +1,35 @@ +pyrvt.peak\_calculators.WangRathje2018 +====================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: WangRathje2018 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~WangRathje2018.__init__ + ~WangRathje2018.limited_num_zero_crossings + ~WangRathje2018.nonstationarity_factor + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~WangRathje2018.ABBREV + ~WangRathje2018.COEFS + ~WangRathje2018.NAME + ~WangRathje2018.abbrev + ~WangRathje2018.min_zero_crossings + ~WangRathje2018.name + + \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..4d261f8 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,40 @@ +# Welcome to pyRVT Documentation + +`pyRVT` provides random vibration theory (RVT) models for use in earthquake +ground motion models. It provides multiple peak factor models in a common +framework such that they can be compared and tested. Additionally, it provides +an interface to define RVT based ground motion models through specificiation of +the Fourier amplitude spectrum, acceleration response spectrum, or calculated by +a seismological models. + +## Peak factor models + +The peak calculators and associated functions are contained within +`pyrvt.peak_calculators`. The primary peak calculators are: + +- [Wang and Rathje (2018)][pyrvt.peak_calculators.WangRathje2018][@wang18] +- [Boore and BooreThompson (2015)][pyrvt.peak_calculators.BooreThompson2015][@boore15] +- [Vanmarcke (1975)][pyrvt.peak_calculators.Vanmarcke1975][@vanmarcke75] + +Additional peak calculators are also provided. See the peak calculator +[API][pyrvt.peak_calculators]. + +## Ground motion models + +Motions for calculating the peak response can be specified by the following +mechanisms. The frequency content of the motion can be specified by providing +the Fourier amplitude spectrum and during in a +[RvtMotion][pyrvt.motions.RvtMotion] instance. Alternatively, a compatible +ground motion can be computed from an acceleration response spectrum and +duration in a [CompatibileRvtMotion][pyrvt.motions.CompatibleRvtMotion] +instance. Seismological models based on a $\omega^2$-model based on the +parameters selected by Campbell (2003)[@campbell03] in a +[SourceTheoryMotion][pyrvt.motions.SourceTheoryMotion] instance, or by the +optimized functional form provided by Stafford et al. (2022)[@stafford22] in a +[StaffordEtAl22Motion][pyrvt.motions.StaffordEtAl22Motion]. + +## Command-line interface + +A command-line interface is provided to convert response spectra to Fourier +amplitude spectra, or vice versa. This inferface as used by Al Atik et al. +(2014)[@alatik14]. diff --git a/docs/javascripts/katex.js b/docs/javascripts/katex.js new file mode 100644 index 0000000..0946ce0 --- /dev/null +++ b/docs/javascripts/katex.js @@ -0,0 +1,10 @@ +document$.subscribe(({ body }) => { + renderMathInElement(body, { + delimiters: [ + { left: "$$", right: "$$", display: true }, + { left: "$", right: "$", display: false }, + { left: "\\(", right: "\\)", display: false }, + { left: "\\[", right: "\\]", display: true }, + ], + }); +}); diff --git a/docs/license.md b/docs/license.md new file mode 100644 index 0000000..f409d45 --- /dev/null +++ b/docs/license.md @@ -0,0 +1 @@ +--8<-- "LICENSE" diff --git a/docs/reference/generated/pyrvt.peak_calculators.BooreJoyner1984.rst b/docs/reference/generated/pyrvt.peak_calculators.BooreJoyner1984.rst new file mode 100644 index 0000000..dcff732 --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.BooreJoyner1984.rst @@ -0,0 +1,33 @@ +pyrvt.peak\_calculators.BooreJoyner1984 +======================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: BooreJoyner1984 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~BooreJoyner1984.__init__ + ~BooreJoyner1984.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~BooreJoyner1984.ABBREV + ~BooreJoyner1984.NAME + ~BooreJoyner1984.abbrev + ~BooreJoyner1984.min_zero_crossings + ~BooreJoyner1984.name + + \ No newline at end of file diff --git a/docs/reference/generated/pyrvt.peak_calculators.BooreThompson2012.rst b/docs/reference/generated/pyrvt.peak_calculators.BooreThompson2012.rst new file mode 100644 index 0000000..c3b1f75 --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.BooreThompson2012.rst @@ -0,0 +1,33 @@ +pyrvt.peak\_calculators.BooreThompson2012 +========================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: BooreThompson2012 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~BooreThompson2012.__init__ + ~BooreThompson2012.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~BooreThompson2012.ABBREV + ~BooreThompson2012.NAME + ~BooreThompson2012.abbrev + ~BooreThompson2012.min_zero_crossings + ~BooreThompson2012.name + + \ No newline at end of file diff --git a/docs/reference/generated/pyrvt.peak_calculators.BooreThompson2015.rst b/docs/reference/generated/pyrvt.peak_calculators.BooreThompson2015.rst new file mode 100644 index 0000000..792f1c5 --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.BooreThompson2015.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.BooreThompson2015 +========================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: BooreThompson2015 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~BooreThompson2015.__init__ + ~BooreThompson2015.limited_num_zero_crossings + ~BooreThompson2015.nonstationarity_factor + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~BooreThompson2015.ABBREV + ~BooreThompson2015.NAME + ~BooreThompson2015.abbrev + ~BooreThompson2015.min_zero_crossings + ~BooreThompson2015.name + + \ No newline at end of file diff --git a/docs/reference/generated/pyrvt.peak_calculators.CartwrightLonguetHiggins1956.rst b/docs/reference/generated/pyrvt.peak_calculators.CartwrightLonguetHiggins1956.rst new file mode 100644 index 0000000..11743a5 --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.CartwrightLonguetHiggins1956.rst @@ -0,0 +1,33 @@ +pyrvt.peak\_calculators.CartwrightLonguetHiggins1956 +==================================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: CartwrightLonguetHiggins1956 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~CartwrightLonguetHiggins1956.__init__ + ~CartwrightLonguetHiggins1956.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~CartwrightLonguetHiggins1956.ABBREV + ~CartwrightLonguetHiggins1956.NAME + ~CartwrightLonguetHiggins1956.abbrev + ~CartwrightLonguetHiggins1956.min_zero_crossings + ~CartwrightLonguetHiggins1956.name + + \ No newline at end of file diff --git a/docs/reference/generated/pyrvt.peak_calculators.Davenport1964.rst b/docs/reference/generated/pyrvt.peak_calculators.Davenport1964.rst new file mode 100644 index 0000000..110079a --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.Davenport1964.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.Davenport1964 +===================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: Davenport1964 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Davenport1964.__init__ + ~Davenport1964.asymtotic_approx + ~Davenport1964.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Davenport1964.ABBREV + ~Davenport1964.NAME + ~Davenport1964.abbrev + ~Davenport1964.min_zero_crossings + ~Davenport1964.name + + \ No newline at end of file diff --git a/docs/reference/generated/pyrvt.peak_calculators.DerKiureghian1985.rst b/docs/reference/generated/pyrvt.peak_calculators.DerKiureghian1985.rst new file mode 100644 index 0000000..a895611 --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.DerKiureghian1985.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.DerKiureghian1985 +========================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: DerKiureghian1985 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~DerKiureghian1985.__init__ + ~DerKiureghian1985.asymtotic_approx + ~DerKiureghian1985.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DerKiureghian1985.ABBREV + ~DerKiureghian1985.NAME + ~DerKiureghian1985.abbrev + ~DerKiureghian1985.min_zero_crossings + ~DerKiureghian1985.name + + \ No newline at end of file diff --git a/docs/reference/generated/pyrvt.peak_calculators.LiuPezeshk1999.rst b/docs/reference/generated/pyrvt.peak_calculators.LiuPezeshk1999.rst new file mode 100644 index 0000000..fc05736 --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.LiuPezeshk1999.rst @@ -0,0 +1,33 @@ +pyrvt.peak\_calculators.LiuPezeshk1999 +====================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: LiuPezeshk1999 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~LiuPezeshk1999.__init__ + ~LiuPezeshk1999.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~LiuPezeshk1999.ABBREV + ~LiuPezeshk1999.NAME + ~LiuPezeshk1999.abbrev + ~LiuPezeshk1999.min_zero_crossings + ~LiuPezeshk1999.name + + \ No newline at end of file diff --git a/docs/reference/generated/pyrvt.peak_calculators.ToroMcGuire1987.rst b/docs/reference/generated/pyrvt.peak_calculators.ToroMcGuire1987.rst new file mode 100644 index 0000000..861757f --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.ToroMcGuire1987.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.ToroMcGuire1987 +======================================= + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: ToroMcGuire1987 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~ToroMcGuire1987.__init__ + ~ToroMcGuire1987.asymtotic_approx + ~ToroMcGuire1987.limited_num_zero_crossings + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ToroMcGuire1987.ABBREV + ~ToroMcGuire1987.NAME + ~ToroMcGuire1987.abbrev + ~ToroMcGuire1987.min_zero_crossings + ~ToroMcGuire1987.name + + \ No newline at end of file diff --git a/docs/reference/generated/pyrvt.peak_calculators.Vanmarcke1975.rst b/docs/reference/generated/pyrvt.peak_calculators.Vanmarcke1975.rst new file mode 100644 index 0000000..f544ac4 --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.Vanmarcke1975.rst @@ -0,0 +1,34 @@ +pyrvt.peak\_calculators.Vanmarcke1975 +===================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: Vanmarcke1975 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Vanmarcke1975.__init__ + ~Vanmarcke1975.limited_num_zero_crossings + ~Vanmarcke1975.nonstationarity_factor + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Vanmarcke1975.ABBREV + ~Vanmarcke1975.NAME + ~Vanmarcke1975.abbrev + ~Vanmarcke1975.min_zero_crossings + ~Vanmarcke1975.name + + \ No newline at end of file diff --git a/docs/reference/generated/pyrvt.peak_calculators.WangRathje2018.rst b/docs/reference/generated/pyrvt.peak_calculators.WangRathje2018.rst new file mode 100644 index 0000000..ee924af --- /dev/null +++ b/docs/reference/generated/pyrvt.peak_calculators.WangRathje2018.rst @@ -0,0 +1,35 @@ +pyrvt.peak\_calculators.WangRathje2018 +====================================== + +.. currentmodule:: pyrvt.peak_calculators + +.. autoclass:: WangRathje2018 + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~WangRathje2018.__init__ + ~WangRathje2018.limited_num_zero_crossings + ~WangRathje2018.nonstationarity_factor + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~WangRathje2018.ABBREV + ~WangRathje2018.COEFS + ~WangRathje2018.NAME + ~WangRathje2018.abbrev + ~WangRathje2018.min_zero_crossings + ~WangRathje2018.name + + \ No newline at end of file diff --git a/docs/reference/index.rst b/docs/reference/index.rst new file mode 100644 index 0000000..40f206c --- /dev/null +++ b/docs/reference/index.rst @@ -0,0 +1,9 @@ +API Reference +============= + +.. toctree:: + :noindex: + + peak_calculators + motions + tools diff --git a/docs/reference/motions.rst b/docs/reference/motions.rst new file mode 100644 index 0000000..09965fc --- /dev/null +++ b/docs/reference/motions.rst @@ -0,0 +1,35 @@ +Motions +======= + +.. currentmodule:: pyrvt.motions + +Primary classes +--------------- + +.. autoclass:: RvtMotion + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: SourceTheoryMotion + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: CompatibleRvtMotion + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +Helper functions +---------------- + +.. autofunction:: calc_geometric_spreading +.. autofunction:: calc_stress_drop +.. autofunction:: calc_sdof_tf +.. autofunction:: log_spaced_values +.. autofunction:: sort_increasing + diff --git a/docs/reference/peak_calculators.rst b/docs/reference/peak_calculators.rst new file mode 100644 index 0000000..39ae740 --- /dev/null +++ b/docs/reference/peak_calculators.rst @@ -0,0 +1,83 @@ +Peak calculators +================ + +.. currentmodule:: pyrvt.peak_calculators + +Primary classes +--------------- + +.. autoclass:: Calculator + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: Vanmarcke1975 + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: DerKiureghian1985 + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: ToroMcGuire1987 + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: CartwrightLonguetHiggins1956 + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: BooreJoyner1984 + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: LiuPezeshk1999 + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: BooreThompson + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: BooreThompson2012 + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: BooreThompson2015 + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +.. autoclass:: WangRathje2018 + :members: + :show-inheritance: + :special-members: __call__ + :private-members: + +Helper functions +---------------- + +.. autofunction:: get_peak_calculator + +.. autofunction:: calc_moments + +.. autoclass:: SquaredSpectrum + :members: diff --git a/docs/reference/tools.rst b/docs/reference/tools.rst new file mode 100644 index 0000000..775c305 --- /dev/null +++ b/docs/reference/tools.rst @@ -0,0 +1,15 @@ +Tools +===== + +.. currentmodule:: pyrvt.tools + + +.. autofunction:: read_events + +.. autofunction:: write_events + +.. autofunction:: calc_compatible_spectra + +.. autofunction:: operation_psa2fa + +.. autofunction:: operation_fa2psa diff --git a/docs/usage/cli.md b/docs/usage/cli.md new file mode 100644 index 0000000..a53c441 --- /dev/null +++ b/docs/usage/cli.md @@ -0,0 +1,71 @@ +# Command-line interface + +`pyRVT` can be used from the command line by executing `pyrvt` with a number of arguments. These +arguments can be found by running `pyrvt`, which will produce the +following output: + +```bash +❯ pyrvt --help +usage: pyrvt [-h] [--version] -i INPUT [-o OUTPUT] [-d DAMPING] [-f] + [-m {BJ84,BT12,DK85,LP99,TM87,V75,WR18}] + {psa2fa,fa2psa} + +Compute response or Fourier amplitude spectra using RVT. + +positional arguments: + {psa2fa,fa2psa} Operation to be performed: [psa2fa] converts + from pseudo-spectral acceleration to Fourier + amplitude, and [fa2psa] converts from Fourier + amplitude to pseudo-spectral acceleration. + +options: + -h, --help show this help message and exit + --version show program's version number and exit + + -i INPUT, --input INPUT + Path containing the input file(s). Supported + file types are csv, xls, and xlsx -- provided + the required packages have been installed. A + single file or glob can be specified. An + example of a glob would be "input/*_sa.xls" + for all files within directory "input" ending + in "_sa.xls". + + -o OUTPUT, --output OUTPUT + Path where the output files should be created. + If this directory does not exist it will be + created. Default: ./output + + -d DAMPING, --damping DAMPING + Oscillator damping in decimal. Default: 0.05. + + -f, --fixed-spacing Fixed spacing of the oscillator period of 0.01 + to 10 sec log-spaced with 100 points. Target + SA values will be interpolated if needed + + -m {BJ84,BT12,DK85,LP99,TM87,V75,WR18}, + --method {BJ84,BT12,DK85,LP99,TM87,V75,WR18} + Specify the peak factor calculation method. + Possible options are: [BJ84] Boore and Joyner + (1984), [BT12] Boore and Thompson (2012), + [DK85] Der Kiureghian (1985), [LP99] Liu and + Pezeshk (1999), [TM87] Toro and McGuire + (1987), [V75] Vanmarcke (1975), and [WR18] + Wang and Rathje (2018). If the BT12 method is + used, then the magnitude, distance and region + must be provided by the input files. If no + value is provided, then "V75" is used as the + default. +``` + +For example, to compute the Fourier amplitude spectra that were compatible with +target response spectrum the following command could be used: + +```bash +$ pyrvt psa2fa -i examples\example_targetSa.csv +``` + +The required format for the events is best understood by looking at one of the +example event files. The name of the input file should include an underscore +(i.e., '\_') during the creation of the output everything to the left of the +last underscore is repeated. diff --git a/docs/usage/library.md b/docs/usage/library.md new file mode 100644 index 0000000..0c0ad56 --- /dev/null +++ b/docs/usage/library.md @@ -0,0 +1,7 @@ +--- +title: Usage +--- + +# Usage + +## Peak calculators diff --git a/docs/user-guide.rst b/docs/user-guide.rst new file mode 100644 index 0000000..91c3706 --- /dev/null +++ b/docs/user-guide.rst @@ -0,0 +1,59 @@ +Command line usage +================== + +pyrvt can be used from the command line by executing ``pyrvt`` with a number of arguments. These +arguments can be found by running ``pyrvt``, which will produce the +following output: + +.. code-block:: + + $ pyrvt --help + usage: pyrvt [-h] [--version] -i INPUT [-o OUTPUT] [-d DAMPING] [-f] + [-m {BJ84,BT12,DK85,LP99,TM87,V75}] + {psa2fa,fa2psa} + + Compute response or Fourier amplitude spectra using RVT. + + positional arguments: + {psa2fa,fa2psa} Operation to be performed: [psa2fa] converts from pseudo-spectral + acceleration to Fourier amplitude, and [fa2psa] converts from + Fourier amplitude to pseudo-spectral acceleration. + + options: + -h, --help show this help message and exit + --version show program\'s version number and exit + -i INPUT, --input INPUT + Path containing the input file(s). Supported file types are csv, + xls, and xlsx -- provided the required packages have been + installed. A single file or glob can be specified. An example of + a glob would be "input/*_sa.xls" for all files within directory + "input" ending in "_sa.xls". + -o OUTPUT, --output OUTPUT + Path where the output files should be created. If this directory + does not exist it will be created. Default: ./output + -d DAMPING, --damping DAMPING + Oscillator damping in decimal. Default: 0.05. + -f, --fixed-spacing Fixed spacing of the oscillator period of 0.01 to 10 sec log- + spaced with 100 points. Target SA values will be interpolated if + needed + -m {BJ84,BT12,DK85,LP99,TM87,V75}, --method {BJ84,BT12,DK85,LP99,TM87,V75} + Specify the peak factor calculation method. Possible options are: + [BJ84] Boore and Joyner (1984), [BT12] Boore and Thompson (2012), + [DK85] Der Kiureghian (1985), [LP99] Liu and Pezeshk (1999), + [TM87] Toro and McGuire (1987), and [V75] Vanmarcke (1975). If + the BT12 method is used, then the magnitude, distance and region + must be provided by the input files. If no value is provided, + then "V75" is used as the default. + + +For example, to compute the Fourier amplitude spectra that were compatible with +target response spectrum the following command could be used: + +.. code-block:: bash + + $ pyrvt psa2fa -i examples\example_targetSa.csv + +The required format for the events is best understood by looking at one of the +example event files. The name of the input file should include an underscore +(i.e., '_') during the creation of the output everything to the left of the +last underscore is repeated. diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..162ae6d --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,108 @@ +site_name: pyRVT Documentation +site_url: https://readthedocs.org/projects/pyrvt/ +watch: [mkdocs.yml, README.md, CONTRIBUTING.md, CHANGELOG.md, src/pyrvt] +copyright: Copyright © 2023 Albert Kottke + +nav: + - Home: + - Overview: index.md + - Changelog: changelog.md + - Authors: authors.md + - License: license.md + - Usage: + - Library: usage/library.md + - CLI: usage/cli.md + - API Reference: + - pyrvt: reference/ + - Development: + - Contributing: contributing.md + - Coverage report: coverage.md +theme: + name: material + features: + - announce.dismiss + - content.action.view + - content.code.annotate + - content.code.copy + - content.tooltips + - navigation.footer + - navigation.indexes + - navigation.sections + - navigation.tabs + - navigation.tabs.sticky + - navigation.top + - search.highlight + - search.suggest + - toc.follow + +plugins: + - gen-files: + scripts: + - scripts/gen_ref_pages.py + - literate-nav: + nav_file: SUMMARY.md + - coverage + - mkdocstrings: + enable_inventory: true + handlers: + python: + paths: + - src + options: + docstring_style: numpy + docstring_options: + ignore_init_summary: true + docstring_section_style: list + filters: ["!^_"] + heading_level: 1 + inherited_members: true + merge_init_into_class: true + separate_signature: true + show_signature_annotations: true + line_length: 60 + show_root_heading: true + show_root_full_path: false + show_symbol_type_heading: true + show_symbol_type_toc: true + signature_crossrefs: true + summary: true + - mkdocs-jupyter: + ignore_h1_titles: True + include: + ["examples/*.ipynb"] # Default: ["*.py", "*.ipynb"] + # ignore: ["some-irrelevant-files/*.ipynb"] + - bibtex: + bib_file: "docs/refs.bib" + - search +markdown_extensions: + - attr_list + - admonition + - callouts + - pymdownx.arithmatex: + generic: true + - pymdownx.details + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - footnotes + - pymdownx.magiclink + - pymdownx.snippets: + base_path: [!relative $config_dir] + check_paths: true + - pymdownx.superfences + - pymdownx.tabbed: + alternate_style: true + slugify: !!python/object/apply:pymdownx.slugs.slugify + kwds: + case: lower + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + +extra_javascript: + - javascripts/katex.js + - https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.js + - https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/contrib/auto-render.min.js + +extra_css: + - https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.css diff --git a/scripts/gen_ref_pages.py b/scripts/gen_ref_pages.py new file mode 100644 index 0000000..6d92c7d --- /dev/null +++ b/scripts/gen_ref_pages.py @@ -0,0 +1,37 @@ +"""Generate the code reference pages and navigation.""" + +from pathlib import Path + +import mkdocs_gen_files + +nav = mkdocs_gen_files.Nav() +# Add classification +mod_symbol = '' + +src = Path(__file__).parent.parent / "src" + +for path in sorted(src.rglob("*.py")): + module_path = path.relative_to(src).with_suffix("") + doc_path = path.relative_to(src).with_suffix(".md") + full_doc_path = Path("reference", doc_path) + + parts = tuple(module_path.parts) + + if parts[-1] == "__init__": + parts = parts[:-1] + doc_path = doc_path.with_name("index.md") + full_doc_path = full_doc_path.with_name("index.md") + elif parts[-1] == "__main__": + continue + + nav_parts = [f"{mod_symbol} {part}" for part in parts] + nav[tuple(nav_parts)] = doc_path.as_posix() + + with mkdocs_gen_files.open(full_doc_path, "w") as fd: + ident = ".".join(parts) + fd.write(f"::: {ident}") + + mkdocs_gen_files.set_edit_path(full_doc_path, path) + +with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: + nav_file.writelines(nav.build_literate_nav()) diff --git a/src/pyrvt/data/sea22-site_amp.csv.gz b/src/pyrvt/data/sea22-site_amp.csv.gz new file mode 100644 index 0000000..81ecc5a Binary files /dev/null and b/src/pyrvt/data/sea22-site_amp.csv.gz differ