ourocode 1.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ourocode might be problematic. Click here for more details.
- ourocode/__init__.py +0 -0
- ourocode/__version__.py +1 -0
- ourocode/data/caracteristique_meca_acier.csv +33 -0
- ourocode/data/caracteristique_meca_bois.csv +59 -0
- ourocode/data/carte_action_region.csv +36722 -0
- ourocode/data/coeff_psy.csv +13 -0
- ourocode/data/exploitation.csv +17 -0
- ourocode/data/gammaM.csv +14 -0
- ourocode/data/kdef.csv +11 -0
- ourocode/data/kfi.csv +10 -0
- ourocode/data/kmod.csv +16 -0
- ourocode/data/limite_fleche.csv +9 -0
- ourocode/data/qualite_acier.csv +18 -0
- ourocode/data/screenshot/C90_def.png +0 -0
- ourocode/data/screenshot/Kv_def.png +0 -0
- ourocode/data/screenshot/fleche.png +0 -0
- ourocode/data/screenshot/sign_convention.png +0 -0
- ourocode/data/section_boulon.csv +12 -0
- ourocode/data/vent/vent_Cp_toiture_isolee_1_versant.csv +22 -0
- ourocode/data/vent/vent_Cp_toiture_isolee_1_versant.png +0 -0
- ourocode/data/vent/vent_Cp_toiture_isolee_2_versants.csv +31 -0
- ourocode/data/vent/vent_Cp_toiture_isolee_2_versants.png +0 -0
- ourocode/data/vent/vent_Cpe_mur_verticaux.csv +11 -0
- ourocode/data/vent/vent_Cpe_mur_verticaux.png +0 -0
- ourocode/data/vent/vent_Cpe_toiture_1_versant.png +0 -0
- ourocode/data/vent/vent_Cpe_toiture_1_versant_0_degres.csv +13 -0
- ourocode/data/vent/vent_Cpe_toiture_1_versant_180_degres.csv +13 -0
- ourocode/data/vent/vent_Cpe_toiture_1_versant_90_degres.csv +13 -0
- ourocode/data/vent/vent_Cpe_toiture_2_versants.png +0 -0
- ourocode/data/vent/vent_Cpe_toiture_2_versants_0_degres.csv +21 -0
- ourocode/data/vent/vent_Cpe_toiture_2_versants_90_degres.csv +21 -0
- ourocode/data/vent/vent_Cpe_toiture_terrasse.csv +21 -0
- ourocode/data/vent/vent_Cpe_toiture_terrasse.png +0 -0
- ourocode/data/vent/vent_Ffr.png +0 -0
- ourocode/eurocode/A0_Projet.py +1408 -0
- ourocode/eurocode/EC0_Combinaison.py +1763 -0
- ourocode/eurocode/EC1_Exploitation.py +103 -0
- ourocode/eurocode/EC1_Neige.py +385 -0
- ourocode/eurocode/EC1_Vent.py +1388 -0
- ourocode/eurocode/EC3_Assemblage.py +466 -0
- ourocode/eurocode/EC3_Element_droit.py +302 -0
- ourocode/eurocode/EC5_Assemblage.py +1760 -0
- ourocode/eurocode/EC5_Element_droit.py +1740 -0
- ourocode/eurocode/EC5_Feu.py +922 -0
- ourocode/eurocode/EC8_Sismique.py +2 -0
- ourocode/eurocode/__init__.py +0 -0
- ourocode/eurocode/logical.py +83 -0
- ourocode/eurocode/objet.py +263 -0
- ourocode-1.6.0.dist-info/METADATA +331 -0
- ourocode-1.6.0.dist-info/RECORD +53 -0
- ourocode-1.6.0.dist-info/WHEEL +5 -0
- ourocode-1.6.0.dist-info/licenses/LICENSE +201 -0
- ourocode-1.6.0.dist-info/top_level.txt +1 -0
|
File without changes
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from ourocode.eurocode.objet import Objet
|
|
2
|
+
|
|
3
|
+
class And(Objet):
|
|
4
|
+
def __init__(self):
|
|
5
|
+
super().__init__()
|
|
6
|
+
pass
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class For(Objet):
|
|
10
|
+
def __init__(self, liste: list, index: int=None, key: str=None, start: int=None, stop: int=None, **kwargs):
|
|
11
|
+
"""Boucle sur les valeurs d'une liste, en option on peux donner un index pour retourner une valeur spécifique d'une sous liste et une clé pour un dictionnaire.
|
|
12
|
+
On peut aussi donner un start et un stop pour boucler que sur une partie de la liste.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
liste (list): la liste sur laquelle on doit itérer.
|
|
16
|
+
index (int|otional): l'index optionnel.
|
|
17
|
+
key (str, optional): on utilise la clé spécifique si la liste transmise est un dictionnaire.
|
|
18
|
+
|
|
19
|
+
Returns:
|
|
20
|
+
Retourne l'item présent dans la liste.
|
|
21
|
+
"""
|
|
22
|
+
super().__init__()
|
|
23
|
+
self.liste = liste
|
|
24
|
+
self.index = index
|
|
25
|
+
self.key = key
|
|
26
|
+
self.start = start
|
|
27
|
+
self.stop = stop
|
|
28
|
+
self.counter = -1
|
|
29
|
+
self.selected_item = None
|
|
30
|
+
|
|
31
|
+
for key, val in kwargs.items():
|
|
32
|
+
setattr(self, key, val)
|
|
33
|
+
|
|
34
|
+
self._get_items()
|
|
35
|
+
|
|
36
|
+
def _get_items(self):
|
|
37
|
+
"""Détermine le début d'une boucle
|
|
38
|
+
"""
|
|
39
|
+
self.items = []
|
|
40
|
+
if isinstance(self.liste, list):
|
|
41
|
+
strt = 0
|
|
42
|
+
stp = len(self.liste)+1
|
|
43
|
+
if self.start:
|
|
44
|
+
strt = self.start
|
|
45
|
+
if self.stop:
|
|
46
|
+
stp = self.stop
|
|
47
|
+
self.liste = self.liste[strt:stp]
|
|
48
|
+
for item in self.liste:
|
|
49
|
+
if self.index:
|
|
50
|
+
self.items.append(item[self.index])
|
|
51
|
+
else:
|
|
52
|
+
self.items.append(item)
|
|
53
|
+
elif isinstance(self.liste, dict):
|
|
54
|
+
for item in self.liste.values():
|
|
55
|
+
if self.key:
|
|
56
|
+
self.items.append(item[self.key])
|
|
57
|
+
else:
|
|
58
|
+
self.items.append(item)
|
|
59
|
+
return self.items
|
|
60
|
+
|
|
61
|
+
def _get_item(self, selection="Tous"):
|
|
62
|
+
"""Retourne un élément spécifique ou la sélection."""
|
|
63
|
+
if selection == "Tous":
|
|
64
|
+
self.counter += 1
|
|
65
|
+
if self.counter >= len(self.items):
|
|
66
|
+
self.counter = 0
|
|
67
|
+
self.selected_item = self.items[self.counter]
|
|
68
|
+
else:
|
|
69
|
+
for item in self.items:
|
|
70
|
+
if item == selection:
|
|
71
|
+
self.selected_item = item
|
|
72
|
+
return self.selected_item
|
|
73
|
+
|
|
74
|
+
def get_min_value_in_loop():
|
|
75
|
+
"""Retourne la valeur de sortie de la boucle pour laquelle le résultat (valeur numérique uniquement) est le plus faible.
|
|
76
|
+
Le résultat peut ce trouver dans un dictionnaire, une liste, un tuple. Si c'est le cas alors on parcours toute les valeurs numérique et l'on récupère la plus faible.
|
|
77
|
+
Cette méthode permet pour exemple de trouver le taux de travail le plus faible dans une
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
result (float): le résultat à comparer avec la précédente valeur minimal
|
|
81
|
+
|
|
82
|
+
"""
|
|
83
|
+
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# coding in UTF-8
|
|
2
|
+
# by Anthony PARISOT
|
|
3
|
+
|
|
4
|
+
import os
|
|
5
|
+
import json
|
|
6
|
+
import math as mt
|
|
7
|
+
import importlib.resources as pkg_resources
|
|
8
|
+
from PIL import Image
|
|
9
|
+
import pandas as pd
|
|
10
|
+
import pickle
|
|
11
|
+
import inspect
|
|
12
|
+
from PySide6.QtWidgets import QFileDialog
|
|
13
|
+
# from tkinter import filedialog
|
|
14
|
+
|
|
15
|
+
import forallpeople as si
|
|
16
|
+
si.environment("structural")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def get_package_path(package):
|
|
20
|
+
# Obtenir le chemin du fichier principal du module
|
|
21
|
+
package_path = os.path.dirname(package.__file__)
|
|
22
|
+
return package_path
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Objet(object):
|
|
26
|
+
"""Classe permetant la sauvegarde ou l'ouverture d'un objet ou de plusieur sous un fichier .ec
|
|
27
|
+
"""
|
|
28
|
+
OPERATOR = ("+", "-", "x", "/")
|
|
29
|
+
try:
|
|
30
|
+
import ourocode
|
|
31
|
+
PATH_CATALOG = os.path.join(get_package_path(ourocode))
|
|
32
|
+
except:
|
|
33
|
+
PATH_CATALOG = os.path.join(os.getcwd(), "ourocode")
|
|
34
|
+
|
|
35
|
+
def _data_from_csv(self, data_file: str, index_col=0):
|
|
36
|
+
""" Retourne un dataframe d'un fichier CSV """
|
|
37
|
+
repertory = os.path.join(self.PATH_CATALOG, "data", data_file)
|
|
38
|
+
data_csv = pd.read_csv(repertory, sep=';', header=0, index_col=index_col)
|
|
39
|
+
return data_csv
|
|
40
|
+
|
|
41
|
+
def _data_from_json(self, data_file: str):
|
|
42
|
+
""" Retourne un dataframe d'un fichier JSON """
|
|
43
|
+
repertory = os.path.join(self.PATH_CATALOG, "data", data_file)
|
|
44
|
+
data_json = pd.read_json(repertory)
|
|
45
|
+
return data_json
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def objet(self):
|
|
50
|
+
"""Retourne l'objet lui même.
|
|
51
|
+
"""
|
|
52
|
+
return self
|
|
53
|
+
|
|
54
|
+
def get_value(self, value: str, index: int=None, key: str=None):
|
|
55
|
+
"""Retourne l'argument transmit.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
index (int, optional): index à retourner dans une liste python.
|
|
59
|
+
Attention sous pyhon le premier élément d'une liste ce trouve à l'index 0.
|
|
60
|
+
key (str, optional): clé à renvoyer dans un dictionnaire python.
|
|
61
|
+
"""
|
|
62
|
+
if index:
|
|
63
|
+
value = list(value)[index]
|
|
64
|
+
elif key:
|
|
65
|
+
value = f"{value.replace("'", '"')}"
|
|
66
|
+
value = json.loads(value)[key]
|
|
67
|
+
return str(value)
|
|
68
|
+
|
|
69
|
+
def operation_between_values(self, value1: float, value2: float, operator: str=OPERATOR):
|
|
70
|
+
"""Retourne l'opération donnée entre la valeur 1 et la valeur 2.
|
|
71
|
+
Pour les calculs trigonométrique, la valeur 2 est en degré."""
|
|
72
|
+
if operator not in self.OPERATOR:
|
|
73
|
+
raise ValueError(f"Invalid operator: {operator}")
|
|
74
|
+
match operator:
|
|
75
|
+
case "+":
|
|
76
|
+
result = value1 + value2
|
|
77
|
+
case "-":
|
|
78
|
+
result = value1 - value2
|
|
79
|
+
case "x":
|
|
80
|
+
result = value1 * value2
|
|
81
|
+
case "/":
|
|
82
|
+
result = value1 / value2
|
|
83
|
+
return result
|
|
84
|
+
|
|
85
|
+
def abs_value(self, value: float):
|
|
86
|
+
"""Retourne la valeur absolue.
|
|
87
|
+
"""
|
|
88
|
+
return abs(float(value))
|
|
89
|
+
|
|
90
|
+
def max(self, value1: float, value2: float):
|
|
91
|
+
"""Retourne la valeur max entre la valeur 1 et valeur 2.
|
|
92
|
+
"""
|
|
93
|
+
return max(float(value1), float(value2))
|
|
94
|
+
|
|
95
|
+
def min(self, value1: float, value2: float):
|
|
96
|
+
"""Retourne la valeur min entre la valeur 1 et valeur 2.
|
|
97
|
+
"""
|
|
98
|
+
return min(float(value1), float(value2))
|
|
99
|
+
|
|
100
|
+
def cos(self, value: float):
|
|
101
|
+
"""Retourne le cosinus de la valeur donnée en degré."""
|
|
102
|
+
return mt.cos(mt.radians(float(value)))
|
|
103
|
+
|
|
104
|
+
def sin(self, value: float):
|
|
105
|
+
"""Retourne le sinus de la valeur donnée en degré."""
|
|
106
|
+
return mt.sin(mt.radians(float(value)))
|
|
107
|
+
|
|
108
|
+
def tan(self, value: float):
|
|
109
|
+
"""Retourne la tangente de la valeur donnée en degré."""
|
|
110
|
+
return mt.tan(mt.radians(float(value)))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def _convert_unit_physical(cls, value: int|float, si_unit: si.Physical, unit_to_convert: si.Physical):
|
|
115
|
+
"""Convertie l'unité de base dans l'unité nécessaire à l'instanciation de la classe parente
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
value (int|float): valeur à convertir
|
|
119
|
+
si_unit (si.Physical): unité si de base
|
|
120
|
+
unit_to_convert (si.Physical): unité dans la quelle convertir
|
|
121
|
+
"""
|
|
122
|
+
si_unit, unit_to_convert = str(si_unit), str(unit_to_convert)
|
|
123
|
+
if si_unit != unit_to_convert:
|
|
124
|
+
if si_unit == str(si.m):
|
|
125
|
+
if unit_to_convert == str(si.mm):
|
|
126
|
+
return value * 10**3
|
|
127
|
+
elif si_unit == str(si.m**2):
|
|
128
|
+
if unit_to_convert == str(si.mm**2):
|
|
129
|
+
return value * 10**6
|
|
130
|
+
elif si_unit == str(si.m**3):
|
|
131
|
+
if unit_to_convert == str(si.mm**3):
|
|
132
|
+
return value * 10**9
|
|
133
|
+
elif si_unit == str(si.m**4):
|
|
134
|
+
if unit_to_convert == str(si.mm**4):
|
|
135
|
+
return value * 10**12
|
|
136
|
+
elif si_unit == str(si.N):
|
|
137
|
+
if unit_to_convert == str(si.kN):
|
|
138
|
+
return value * 10**-3
|
|
139
|
+
elif si_unit == str(si.Pa):
|
|
140
|
+
if unit_to_convert == str(si.MPa):
|
|
141
|
+
return value * 10**-6
|
|
142
|
+
return value
|
|
143
|
+
|
|
144
|
+
@classmethod
|
|
145
|
+
def _reset_physical_dictionnary(cls, objet: object, dictionnary: dict) -> dict:
|
|
146
|
+
"""Class méthode permetant de réinitialiser les valeurs physiques d'un dictionnaire d'argument d'une classe parent.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
objet (object): l'objet à réinitailiser
|
|
150
|
+
dictionnary (dict): le dictionnaire d'argument de la classe parent
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
dict: le dictionnaire d'argument de la classe parent avec les valeurs physiques réinitialisées
|
|
154
|
+
"""
|
|
155
|
+
dict_physical = {}
|
|
156
|
+
# Si un argument utilise forallpeople on récupère que la valeur pour ne pas multiplier l'unité par elle même
|
|
157
|
+
for key, val in dictionnary.items():
|
|
158
|
+
if isinstance(val, si.Physical):
|
|
159
|
+
physical = val.split(base_value=True)
|
|
160
|
+
# On test si l'objet est une classe ou une instance de classe
|
|
161
|
+
if isinstance(objet, type):
|
|
162
|
+
mro = objet.mro()
|
|
163
|
+
else:
|
|
164
|
+
mro = type(objet).mro()
|
|
165
|
+
for objt in mro:
|
|
166
|
+
spec = inspect.getfullargspec(objt.__init__).annotations
|
|
167
|
+
if spec.get(key):
|
|
168
|
+
unit = spec[key]
|
|
169
|
+
value = cls._convert_unit_physical(physical[0], physical[1], unit)
|
|
170
|
+
dict_physical[key] = value
|
|
171
|
+
break
|
|
172
|
+
return dict_physical
|
|
173
|
+
|
|
174
|
+
@classmethod
|
|
175
|
+
def _reset_physical_object(cls, objet: object):
|
|
176
|
+
"""Class méthode permetant de réinitialiser les valeurs physiques d'un objet d'une classe parent.
|
|
177
|
+
"""
|
|
178
|
+
dictionnary = objet.__dict__
|
|
179
|
+
return cls._reset_physical_dictionnary(objet, dictionnary)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
@classmethod
|
|
184
|
+
def _from_dict(cls, dictionary:dict):
|
|
185
|
+
"""Class méthode permetant l'intanciation des classe hérité de la classe parent, par une classe déjà instanciée.
|
|
186
|
+
|
|
187
|
+
Args:
|
|
188
|
+
object (class object): l'objet Element déjà créer par l'utilisateur
|
|
189
|
+
"""
|
|
190
|
+
return cls(**dictionary)
|
|
191
|
+
|
|
192
|
+
@classmethod
|
|
193
|
+
def _from_parent_class(cls, objet: list|object, **kwargs):
|
|
194
|
+
"""Class méthode permetant l'intanciation des classe hérité de la classe parent, par une classe déjà instanciée.
|
|
195
|
+
|
|
196
|
+
Args:
|
|
197
|
+
object (class object): l'objet Element déjà créer par l'utilisateur
|
|
198
|
+
"""
|
|
199
|
+
dict_objet = {}
|
|
200
|
+
if isinstance(objet, list):
|
|
201
|
+
for obj in objet:
|
|
202
|
+
dict_objet.update(obj.__dict__)
|
|
203
|
+
dict_objet.update(Objet._reset_physical_object(obj))
|
|
204
|
+
else:
|
|
205
|
+
dict_objet = objet.__dict__
|
|
206
|
+
dict_objet.update(Objet._reset_physical_object(objet))
|
|
207
|
+
return cls(**dict_objet, **kwargs)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def _save_muliple_objects(self, object: list):
|
|
211
|
+
save_file_path = QFileDialog.getSaveFileName(
|
|
212
|
+
filter="Ourea catalog object (*.oco);;'Text Document' (*.txt)",
|
|
213
|
+
selectedFilter=".oco",
|
|
214
|
+
)[0]
|
|
215
|
+
# with filedialog.asksaveasfile('wb', filetypes=(("Ourea catalog object", "*.oco"), ('Text Document', '*.txt')), defaultextension='.oco') as f:
|
|
216
|
+
with open(save_file_path, "wb") as f:
|
|
217
|
+
for ligne in object:
|
|
218
|
+
pickle.dump(ligne, f)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def save_object(self):
|
|
222
|
+
save_file_path = QFileDialog.getSaveFileName(
|
|
223
|
+
filter="Ourea catalog object (*.oco);;'Text Document' (*.txt)",
|
|
224
|
+
selectedFilter=".oco",
|
|
225
|
+
)[0]
|
|
226
|
+
with open(save_file_path, "wb") as f:
|
|
227
|
+
pickle.dump(self, f)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def _show_element(self, picture: str):
|
|
231
|
+
"""Affiche l'image des caractéristiques d'une entaille au cisaillement
|
|
232
|
+
"""
|
|
233
|
+
file = os.path.join(self.PATH_CATALOG, "data", "screenshot", picture)
|
|
234
|
+
image = Image.open(file)
|
|
235
|
+
image.show()
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
@classmethod
|
|
239
|
+
def _open_multiple_objects(cls):
|
|
240
|
+
data = []
|
|
241
|
+
# with filedialog.askopenfile('rb', filetypes=(("Ourea catalog object", "*.oco"), ('Text Document', '*.txt')), defaultextension='.oco') as f:
|
|
242
|
+
file_path = QFileDialog.getOpenFileName(
|
|
243
|
+
filter="Ourea catalog object (*.oco);;'Text Document' (*.txt)", selectedFilter=".oco"
|
|
244
|
+
)[0]
|
|
245
|
+
with open(file_path, "rb") as f:
|
|
246
|
+
while True:
|
|
247
|
+
try:
|
|
248
|
+
data.append(pickle.load(f))
|
|
249
|
+
except EOFError:
|
|
250
|
+
break
|
|
251
|
+
return data
|
|
252
|
+
|
|
253
|
+
@classmethod
|
|
254
|
+
def _open_object(cls, path: str=None):
|
|
255
|
+
if not path:
|
|
256
|
+
file_path = QFileDialog.getOpenFileName(
|
|
257
|
+
filter="Ourea catalog object (*.oco);;'Text Document' (*.txt)", selectedFilter=".oco"
|
|
258
|
+
)[0]
|
|
259
|
+
with open(file_path, "rb") as f:
|
|
260
|
+
return pickle.load(f)
|
|
261
|
+
else:
|
|
262
|
+
with open(path, mode="rb") as f:
|
|
263
|
+
return pickle.load(f)
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ourocode
|
|
3
|
+
Version: 1.6.0
|
|
4
|
+
Summary: Ceci est un catalogue de fonction permettant une utilisation rapide pour la réalisation de note de calcul personnalisée.
|
|
5
|
+
Home-page: https://github.com/Icelone73/OUREA-EasyCode
|
|
6
|
+
Author: Anthony PARISOT
|
|
7
|
+
Author-email: Anthony PARISOT <contact@ourea-structure.fr>
|
|
8
|
+
License: Apache License
|
|
9
|
+
Version 2.0, January 2004
|
|
10
|
+
http://www.apache.org/licenses/
|
|
11
|
+
|
|
12
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
13
|
+
|
|
14
|
+
1. Definitions.
|
|
15
|
+
|
|
16
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
17
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
18
|
+
|
|
19
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
20
|
+
the copyright owner that is granting the License.
|
|
21
|
+
|
|
22
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
23
|
+
other entities that control, are controlled by, or are under common
|
|
24
|
+
control with that entity. For the purposes of this definition,
|
|
25
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
26
|
+
direction or management of such entity, whether by contract or
|
|
27
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
28
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
29
|
+
|
|
30
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
31
|
+
exercising permissions granted by this License.
|
|
32
|
+
|
|
33
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
34
|
+
including but not limited to software source code, documentation
|
|
35
|
+
source, and configuration files.
|
|
36
|
+
|
|
37
|
+
"Object" form shall mean any form resulting from mechanical
|
|
38
|
+
transformation or translation of a Source form, including but
|
|
39
|
+
not limited to compiled object code, generated documentation,
|
|
40
|
+
and conversions to other media types.
|
|
41
|
+
|
|
42
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
43
|
+
Object form, made available under the License, as indicated by a
|
|
44
|
+
copyright notice that is included in or attached to the work
|
|
45
|
+
(an example is provided in the Appendix below).
|
|
46
|
+
|
|
47
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
48
|
+
form, that is based on (or derived from) the Work and for which the
|
|
49
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
50
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
51
|
+
of this License, Derivative Works shall not include works that remain
|
|
52
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
53
|
+
the Work and Derivative Works thereof.
|
|
54
|
+
|
|
55
|
+
"Contribution" shall mean any work of authorship, including
|
|
56
|
+
the original version of the Work and any modifications or additions
|
|
57
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
58
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
59
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
60
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
61
|
+
means any form of electronic, verbal, or written communication sent
|
|
62
|
+
to the Licensor or its representatives, including but not limited to
|
|
63
|
+
communication on electronic mailing lists, source code control systems,
|
|
64
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
65
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
66
|
+
excluding communication that is conspicuously marked or otherwise
|
|
67
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
68
|
+
|
|
69
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
70
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
71
|
+
subsequently incorporated within the Work.
|
|
72
|
+
|
|
73
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
77
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
78
|
+
Work and such Derivative Works in Source or Object form.
|
|
79
|
+
|
|
80
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
81
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
82
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
83
|
+
(except as stated in this section) patent license to make, have made,
|
|
84
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
85
|
+
where such license applies only to those patent claims licensable
|
|
86
|
+
by such Contributor that are necessarily infringed by their
|
|
87
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
88
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
89
|
+
institute patent litigation against any entity (including a
|
|
90
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
91
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
92
|
+
or contributory patent infringement, then any patent licenses
|
|
93
|
+
granted to You under this License for that Work shall terminate
|
|
94
|
+
as of the date such litigation is filed.
|
|
95
|
+
|
|
96
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
97
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
98
|
+
modifications, and in Source or Object form, provided that You
|
|
99
|
+
meet the following conditions:
|
|
100
|
+
|
|
101
|
+
(a) You must give any other recipients of the Work or
|
|
102
|
+
Derivative Works a copy of this License; and
|
|
103
|
+
|
|
104
|
+
(b) You must cause any modified files to carry prominent notices
|
|
105
|
+
stating that You changed the files; and
|
|
106
|
+
|
|
107
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
108
|
+
that You distribute, all copyright, patent, trademark, and
|
|
109
|
+
attribution notices from the Source form of the Work,
|
|
110
|
+
excluding those notices that do not pertain to any part of
|
|
111
|
+
the Derivative Works; and
|
|
112
|
+
|
|
113
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
114
|
+
distribution, then any Derivative Works that You distribute must
|
|
115
|
+
include a readable copy of the attribution notices contained
|
|
116
|
+
within such NOTICE file, excluding those notices that do not
|
|
117
|
+
pertain to any part of the Derivative Works, in at least one
|
|
118
|
+
of the following places: within a NOTICE text file distributed
|
|
119
|
+
as part of the Derivative Works; within the Source form or
|
|
120
|
+
documentation, if provided along with the Derivative Works; or,
|
|
121
|
+
within a display generated by the Derivative Works, if and
|
|
122
|
+
wherever such third-party notices normally appear. The contents
|
|
123
|
+
of the NOTICE file are for informational purposes only and
|
|
124
|
+
do not modify the License. You may add Your own attribution
|
|
125
|
+
notices within Derivative Works that You distribute, alongside
|
|
126
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
127
|
+
that such additional attribution notices cannot be construed
|
|
128
|
+
as modifying the License.
|
|
129
|
+
|
|
130
|
+
You may add Your own copyright statement to Your modifications and
|
|
131
|
+
may provide additional or different license terms and conditions
|
|
132
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
133
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
134
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
135
|
+
the conditions stated in this License.
|
|
136
|
+
|
|
137
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
138
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
139
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
140
|
+
this License, without any additional terms or conditions.
|
|
141
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
142
|
+
the terms of any separate license agreement you may have executed
|
|
143
|
+
with Licensor regarding such Contributions.
|
|
144
|
+
|
|
145
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
146
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
147
|
+
except as required for reasonable and customary use in describing the
|
|
148
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
149
|
+
|
|
150
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
151
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
152
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
153
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
154
|
+
implied, including, without limitation, any warranties or conditions
|
|
155
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
156
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
157
|
+
appropriateness of using or redistributing the Work and assume any
|
|
158
|
+
risks associated with Your exercise of permissions under this License.
|
|
159
|
+
|
|
160
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
161
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
162
|
+
unless required by applicable law (such as deliberate and grossly
|
|
163
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
164
|
+
liable to You for damages, including any direct, indirect, special,
|
|
165
|
+
incidental, or consequential damages of any character arising as a
|
|
166
|
+
result of this License or out of the use or inability to use the
|
|
167
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
168
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
169
|
+
other commercial damages or losses), even if such Contributor
|
|
170
|
+
has been advised of the possibility of such damages.
|
|
171
|
+
|
|
172
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
173
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
174
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
175
|
+
or other liability obligations and/or rights consistent with this
|
|
176
|
+
License. However, in accepting such obligations, You may act only
|
|
177
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
178
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
179
|
+
defend, and hold each Contributor harmless for any liability
|
|
180
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
181
|
+
of your accepting any such warranty or additional liability.
|
|
182
|
+
|
|
183
|
+
END OF TERMS AND CONDITIONS
|
|
184
|
+
|
|
185
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
186
|
+
|
|
187
|
+
To apply the Apache License to your work, attach the following
|
|
188
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
189
|
+
replaced with your own identifying information. (Don't include
|
|
190
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
191
|
+
comment syntax for the file format. We also recommend that a
|
|
192
|
+
file or class name and description of purpose be included on the
|
|
193
|
+
same "printed page" as the copyright notice for easier
|
|
194
|
+
identification within third-party archives.
|
|
195
|
+
|
|
196
|
+
Copyright [2025] [Anthony PARISOT]
|
|
197
|
+
|
|
198
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
199
|
+
you may not use this file except in compliance with the License.
|
|
200
|
+
You may obtain a copy of the License at
|
|
201
|
+
|
|
202
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
203
|
+
|
|
204
|
+
Unless required by applicable law or agreed to in writing, software
|
|
205
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
206
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
207
|
+
See the License for the specific language governing permissions and
|
|
208
|
+
limitations under the License.
|
|
209
|
+
Project-URL: Homepage, https://github.com/AnthonyPrst/ourocode
|
|
210
|
+
Classifier: Programming Language :: Python :: 3
|
|
211
|
+
Classifier: Operating System :: OS Independent
|
|
212
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
213
|
+
Requires-Python: >=3.12
|
|
214
|
+
Description-Content-Type: text/markdown
|
|
215
|
+
License-File: LICENSE
|
|
216
|
+
Requires-Dist: handcalcs
|
|
217
|
+
Requires-Dist: forallpeople
|
|
218
|
+
Requires-Dist: PyNiteFEA
|
|
219
|
+
Requires-Dist: pyvista[all,trame]
|
|
220
|
+
Requires-Dist: PySide6
|
|
221
|
+
Requires-Dist: scipy
|
|
222
|
+
Requires-Dist: pandas
|
|
223
|
+
Requires-Dist: Pillow
|
|
224
|
+
Dynamic: author
|
|
225
|
+
Dynamic: home-page
|
|
226
|
+
Dynamic: license-file
|
|
227
|
+
Dynamic: requires-python
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
# 📐 Ourocode - Bibliothèque Python pour le calcul de structure selon les Eurocodes
|
|
231
|
+
|
|
232
|
+
[](LICENSE)
|
|
233
|
+
<!-- [](https://pypi.org/project/ourocode/) -->
|
|
234
|
+
[](https://github.com/AnthonyPrst/ourocode/pyptoject.toml)
|
|
235
|
+
[](https://codecov.io/gh/ton-org/ourocode)
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 🔍 Description
|
|
240
|
+
|
|
241
|
+
**Ourocode** est une bibliothèque Python regroupant les formules normalisées issues des différentes parties des Eurocodes :
|
|
242
|
+
|
|
243
|
+
- **EN 1990** : Bases de calcul
|
|
244
|
+
- **EN 1991** : Actions sur les structures
|
|
245
|
+
- **EN 1993** : Calcul des structures en acier
|
|
246
|
+
- **EN 1995** : Calcul des structures en bois
|
|
247
|
+
|
|
248
|
+
Elle permet de construire un **catalogue de fonctions réutilisables** pour générer rapidement des **notes de calcul personnalisées**, intégrables dans des applications de vérification ou de génération de rapports.
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## 🚀 Objectifs
|
|
253
|
+
|
|
254
|
+
- Offrir une **implémentation fiable et vérifiée** des formules Eurocode.
|
|
255
|
+
- Permettre une **utilisation modulaire** dans des interfaces No-Code, des scripts ou des applications.
|
|
256
|
+
- Fournir une **base open source transparente**, adaptée aux ingénieurs, bureaux d’études, enseignants ou développeurs.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 📦 Installation
|
|
261
|
+
|
|
262
|
+
<!-- ```bash
|
|
263
|
+
pip install ourocode
|
|
264
|
+
``` -->
|
|
265
|
+
|
|
266
|
+
> Installez directement depuis le dépôt :
|
|
267
|
+
```bash
|
|
268
|
+
pip install git+https://github.com/AnthonyPrst/ourocode.git
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## ✨ Fonctionnalités
|
|
274
|
+
|
|
275
|
+
- Calculs normalisés : flexion, traction, cisaillement, flambement, assemblage EC5 et EC3, flèche…
|
|
276
|
+
- Support des classes de résistance bois (C24, GL24h, etc.) et acier (S235, S355…)
|
|
277
|
+
- Prise en compte des effets de feu (EN 1995-1-2)
|
|
278
|
+
- Intégration avec `handcalcs` pour génération LaTeX des formules
|
|
279
|
+
- Compatible avec le logiciel [OUREA-NoCode](https://ourea-structure.fr/telechargement)
|
|
280
|
+
- Organisé en modules clairs par norme et fonction (EN1990, EN1991, etc.)
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## 🛠 Exemple d'utilisation
|
|
285
|
+
|
|
286
|
+
```python
|
|
287
|
+
from eurocode.EC5_Element_droit import Barre
|
|
288
|
+
|
|
289
|
+
panne = Barre(b=100, h=200, section="Rectangulaire", classe="C24", cs=2, Hi=12, Hf=12)
|
|
290
|
+
panne_flexion = Flexion(lo=5000, coeflef=0.9, pos="Charge sur fibre comprimée")
|
|
291
|
+
latex_fmd, fmd = panne_flexion.f_m_d("Moyen terme", "Fondamentales")
|
|
292
|
+
latex_sigmamd, sigmamd = panne_flexion.sigma_m_d(20, axe="y")
|
|
293
|
+
latex_taux, taux = panne_flexion.taux_m_d()
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## ✅ Tests & couverture
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
pytest --cov=eurocode --cov-report=html
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Les tests couvrent les modules principaux.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 🤝 Contribuer
|
|
307
|
+
|
|
308
|
+
Les contributions sont les bienvenues ! Pour proposer une amélioration ou corriger un bug :
|
|
309
|
+
|
|
310
|
+
1. Fork le dépôt
|
|
311
|
+
2. Crée une branche (`git checkout -b feature/ta-fonction`)
|
|
312
|
+
3. Commits (`git commit -am "feat: ajout nouvelle vérif"`),
|
|
313
|
+
4. Pull request 📥
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## 📄 Licence
|
|
318
|
+
|
|
319
|
+
Distribué sous licence **MIT** – libre d’usage, même commercial, avec attribution.
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## 👷 Auteur
|
|
324
|
+
|
|
325
|
+
Développé par **Anthony PARISOT**, ingénieur structure bois & développeur, dans le cadre du projet open source [OUREA STRUCTURE](https://ourea-structure.fr).
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## ⭐ Si vous trouvez ce projet utile...
|
|
330
|
+
|
|
331
|
+
N'hésitez pas à [⭐️ le repo GitHub](https://github.com/Icelone73/ourocode) pour le soutenir !
|