Skip to content

Commit 199272d

Browse files
authored
Update SpecNec_executable_streamlit.py
1 parent 949d279 commit 199272d

File tree

1 file changed

+54
-8
lines changed

1 file changed

+54
-8
lines changed

fun_SPEC_NEC/SpecNec_executable_streamlit.py

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import requests
12
import streamlit as st
23
import numpy as np
34
import pandas as pd
@@ -8,23 +9,69 @@
89
image_path = 'https://raw.githubusercontent.com/Normando1945/Simple-Python-Matlab-JavaSript-Functions-Collection/main/fun_SPEC_NEC/logo_TorreFuerte.png'
910
st.image(image_path, use_column_width=True)
1011

11-
12-
1312
# Título de la aplicación
1413
st.markdown("<h4 style='text-align: center;'>Simple App: Seismic Response Spectrum [Normative Ecuadorian Spectrum]</h4>", unsafe_allow_html=True)
1514

1615

17-
st.markdown(
16+
def get_github_profile_views(username):
17+
url = f"https://api.github.com/users/{username}"
18+
response = requests.get(url)
19+
if response.status_code == 200:
20+
data = response.json()
21+
return data['followers'] # Example of available data
22+
else:
23+
return None
24+
25+
username = "Normando1945"
26+
profile_views = get_github_profile_views(username)
27+
28+
coll1, coll2 = st.columns([4, 1])
29+
30+
coll1.markdown(
1831
"""
19-
* Author: [Msc. Ing. Carlos Andrés Celi Sánchez](https://fragrant-knight-4af.notion.site/Main-Page-5c5f007b3f3f4c76a604960d9dbffca7?pvs=4)
20-
* Course: Structural Dynamics
32+
* Author: [Msc. Ing. Carlos Andrés Celi Sánchez](https://fragrant-knight-4af.notion.site/Main-Page-5c5f007b3f3f4c76a604960d9dbffca7?pvs=4)
33+
* Course: Structural Dynamics
2134
"""
2235
)
2336

24-
st.markdown('* You can find me on : [![Web Page](https://img.shields.io/badge/Web%20Page-caceli.net-blue)](https://fragrant-knight-4af.notion.site/Main-Page-5c5f007b3f3f4c76a604960d9dbffca7?pvs=4)[![GitHub Carlos Celi](https://img.shields.io/github/followers/Normando1945?label=follow&style=social)](https://github.com/Normando1945)[![ResearchGate](https://img.shields.io/badge/-ResearchGate-00CCBB?style=social&logo=researchgate)](https://www.researchgate.net/profile/Carlos-Celi)[![Google Scholar](https://img.shields.io/badge/-Google%20Scholar-4285F4?style=social&logo=google)](https://scholar.google.com.ec/citations?hl=es&user=yR4Gz7kAAAAJ)')
37+
if profile_views is not None:
38+
coll2.metric(label='GitHub Followers', value=profile_views)
39+
else:
40+
coll2.metric(label='GitHub Followers', value="N/A")
41+
42+
43+
44+
st.markdown('You can find me on : [![Web Page](https://img.shields.io/badge/Web%20Page-caceli.net-blue)](https://fragrant-knight-4af.notion.site/Main-Page-5c5f007b3f3f4c76a604960d9dbffca7?pvs=4)[![GitHub Carlos Celi](https://img.shields.io/github/followers/Normando1945?label=follow&style=social)](https://github.com/Normando1945)[![ResearchGate](https://img.shields.io/badge/-ResearchGate-00CCBB?style=social&logo=researchgate)](https://www.researchgate.net/profile/Carlos-Celi)[![Google Scholar](https://img.shields.io/badge/-Google%20Scholar-4285F4?style=social&logo=google)](https://scholar.google.com.ec/citations?hl=es&user=yR4Gz7kAAAAJ)')
2545

2646
st.markdown('This simple app performs spectral calculations using the NEC-SE-DS-2015 Ecuadorian Code. It computes the Elastic and Inelastic Acceleration Response Spectra for a range of structural periods and visualizes the results.')
2747

48+
with st.expander("**Click to read more**"):
49+
j1, j2 = st.columns([1, 2])
50+
with j1:
51+
image_path = 'https://raw.githubusercontent.com/Normando1945/Simple-Python-Matlab-JavaSript-Functions-Collection/main/fun_SPEC_NEC/Chapter1_portada.gif'
52+
st.image(image_path, use_column_width=True)
53+
54+
st.markdown(
55+
"""
56+
<div style="text-align: center;">
57+
<a href="https://cceli.neocities.org"> Online Book, Chapter 1</b></a>
58+
</div>
59+
""",
60+
unsafe_allow_html=True
61+
)
62+
63+
with j2:
64+
st.markdown(
65+
'''
66+
**General Overview**
67+
68+
Welcome to this presentation of the draft for the opening chapter of my upcoming book, titled **"Structural Engineering: Dynamics, Seismic Solution, and AI Integration."** This chapter delves into the intricate realm of undergraduate structural dynamics. This endeavor is not meant to mirror the exhaustive details laid out in some of the field's seminal literature. If you're familiar with works from esteemed authors such as **Chopra**, **Mario Paz**, **Cloth & Penzien**, among others, you'll be aware of the profound depth and rigor they bring to the underlying concepts and mathematical foundations of structural dynamics. Rather than merely echoing their profound insights, this book and the initial chapter provided here chart a distinctive course.
69+
70+
The chief aim is to distill intricate theoretical mathematics into more accessible discrete mathematical frameworks, offering clear outlines of pivotal concepts in dynamic structures. This proves indispensable for students traversing the expansive realm of structural dynamics. By intertwining essential theories with illustrative **Python code samples**, readers will unlock understanding of the fundamental mechanics underpinning both single-degree-of-freedom **SDOF** and multi-degree-of-freedom **MDOF** dynamic systems. The focus remains unwaveringly on applications within structural engineering, positioning this as a prized asset for those immersing themselves in the field. It's vital to understand that this draft of the initial chapter isn't designed to serve as an isolated guide. Instead, it acts in tandem with conventional educational tools, reinforcing the bedrock knowledge students garner in academic settings. For a nuanced and comprehensive grasp of the domain, turning to the venerable tomes of dedicated structural dynamics literature is imperative. When combined with in-depth classroom learning, the revelations from such extensive studies will unquestionably refine a scholar's proficiency. I invite you to join me on this illuminating expedition, and I hope it lays the foundation for your scholastic and professional achievements in structural dynamics.
71+
72+
''', unsafe_allow_html=True
73+
)
74+
2875
st.markdown("#### **Parameters**")
2976

3077

@@ -105,6 +152,7 @@
105152

106153
st.markdown("##### **Response Spectra [Elastic and Inelastic]**")
107154
st.write(Resul)
155+
108156
def display_footer():
109157
footer = """
110158
<style>
@@ -144,5 +192,3 @@ def display_footer():
144192
st.markdown(footer, unsafe_allow_html=True)
145193

146194
display_footer()
147-
148-

0 commit comments

Comments
 (0)