midas-civil 0.2.0__tar.gz → 0.2.2__tar.gz

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 midas-civil might be problematic. Click here for more details.

Files changed (32) hide show
  1. {midas_civil-0.2.0 → midas_civil-0.2.2}/PKG-INFO +1 -1
  2. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_element.py +21 -4
  3. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_load.py +32 -27
  4. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_tendon.py +9 -10
  5. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil.egg-info/PKG-INFO +1 -1
  6. {midas_civil-0.2.0 → midas_civil-0.2.2}/setup.py +1 -1
  7. {midas_civil-0.2.0 → midas_civil-0.2.2}/LICENSE +0 -0
  8. {midas_civil-0.2.0 → midas_civil-0.2.2}/README.md +0 -0
  9. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/__init__.py +0 -0
  10. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_boundary.py +0 -0
  11. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_construction.py +0 -0
  12. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_construction_backup.py +0 -0
  13. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_group.py +0 -0
  14. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_mapi.py +0 -0
  15. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_material.py +0 -0
  16. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_model.py +0 -0
  17. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_movingload.py +0 -0
  18. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_node.py +0 -0
  19. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_result copy.py +0 -0
  20. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_result.py +0 -0
  21. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_result_extract.py +0 -0
  22. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_section.py +0 -0
  23. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_settlement.py +0 -0
  24. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_temperature.py +0 -0
  25. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_thickness.py +0 -0
  26. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_utils.py +0 -0
  27. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil/_view.py +0 -0
  28. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil.egg-info/SOURCES.txt +0 -0
  29. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil.egg-info/dependency_links.txt +0 -0
  30. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil.egg-info/requires.txt +0 -0
  31. {midas_civil-0.2.0 → midas_civil-0.2.2}/midas_civil.egg-info/top_level.txt +0 -0
  32. {midas_civil-0.2.0 → midas_civil-0.2.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: midas_civil
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Python library for MIDAS Civil NX
5
5
  Author: Sumit Shekhar
6
6
  Author-email: sumit.midasit@gmail.com
@@ -231,7 +231,10 @@ class Element:
231
231
  _ADD(self)
232
232
 
233
233
  @staticmethod
234
- def SDL(s_loc:list,dir:list,l:float,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0): #CHANGE TO TUPLE
234
+ def SDL(s_loc:list|Node,dir:list,l:float,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0): #CHANGE TO TUPLE
235
+ if isinstance(s_loc,Node):
236
+ s_loc = (s_loc.X,s_loc.Y,s_loc.Z)
237
+
235
238
  beam_nodes =[]
236
239
  beam_obj = []
237
240
  s_locc = np.array(s_loc)
@@ -251,7 +254,12 @@ class Element:
251
254
 
252
255
 
253
256
  @staticmethod
254
- def SE(s_loc:list,e_loc:list,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
257
+ def SE(s_loc:list|Node,e_loc:list|Node,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
258
+ if isinstance(s_loc,Node):
259
+ s_loc = (s_loc.X,s_loc.Y,s_loc.Z)
260
+ if isinstance(e_loc,Node):
261
+ s_loc = (e_loc.X,e_loc.Y,e_loc.Z)
262
+
255
263
  beam_nodes =[]
256
264
  beam_obj = []
257
265
  i_loc = np.linspace(s_loc,e_loc,n+1)
@@ -302,7 +310,10 @@ class Element:
302
310
  _ADD(self)
303
311
 
304
312
  @staticmethod
305
- def SDL(s_loc:list,dir:list,l:float,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
313
+ def SDL(s_loc:list|Node,dir:list,l:float,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
314
+ if isinstance(s_loc,Node):
315
+ s_loc = (s_loc.X,s_loc.Y,s_loc.Z)
316
+
306
317
  beam_nodes =[]
307
318
  beam_obj =[]
308
319
  s_locc = np.array(s_loc)
@@ -322,7 +333,13 @@ class Element:
322
333
 
323
334
 
324
335
  @staticmethod
325
- def SE(s_loc:list,e_loc:list,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
336
+ def SE(s_loc:list|Node,e_loc:list|Node,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
337
+
338
+ if isinstance(s_loc,Node):
339
+ s_loc = (s_loc.X,s_loc.Y,s_loc.Z)
340
+ if isinstance(e_loc,Node):
341
+ s_loc = (e_loc.X,e_loc.Y,e_loc.Z)
342
+
326
343
  beam_nodes =[]
327
344
  beam_obj = []
328
345
  i_loc = np.linspace(s_loc,e_loc,n+1)
@@ -420,45 +420,52 @@ class Load:
420
420
 
421
421
  #20 Class to add Load to Mass:
422
422
  class LoadToMass:
423
- """Creates load to mass conversion and converts to JSON format.
424
- Example: LoadToMass("Z", ["DL", "LL"], [1.0, 0.5])
423
+ """
424
+ Creates load-to-mass conversion entries and converts them to JSON format.
425
+
426
+ Example:
427
+ Load.LoadToMass("Z", ["DL", "LL"], [1.0, 0.5])
428
+
429
+ Args:
430
+ dir (str):
431
+ Mass Direction - "X", "Y", "Z", "XY", "YZ", "XZ", "XYZ".
432
+ If invalid, defaults to "XYZ".
433
+ load_case (list | str):
434
+ List of load case names or a single case name as string.
435
+ load_factor (list | float, optional):
436
+ List of scale factors corresponding to `load_case`.
437
+ If None or shorter than `load_case`, remaining factors default to 1.0.
438
+ nodal_load (bool, optional):
439
+ Include nodal loads. Defaults to True.
440
+ beam_load (bool, optional):
441
+ Include beam loads. Defaults to True.
442
+ floor_load (bool, optional):
443
+ Include floor loads. Defaults to True.
444
+ pressure (bool, optional):
445
+ Include pressure loads. Defaults to True.
446
+ gravity (float, optional):
447
+ Gravity acceleration. Defaults to 9.806.
425
448
  """
426
449
  data = []
427
450
 
428
451
  def __init__(self, dir, load_case, load_factor=None, nodal_load=True, beam_load=True,
429
452
  floor_load=True, pressure=True, gravity=9.806):
430
- """
431
- dir (str): Mass Direction - "X", "Y", "Z", "XY", "YZ", "XZ", "XYZ"
432
- load_case (list): List of load case names
433
- load_factor (list, optional): List of scale factors corresponding to load cases.
434
- If None or shorter than load_case, remaining factors default to 1.0
435
- nodal_load (bool): Include nodal loads. Defaults to True
436
- beam_load (bool): Include beam loads. Defaults to True
437
- floor_load (bool): Include floor loads. Defaults to True
438
- pressure (bool): Include pressure loads. Defaults to True
439
- gravity (float): Gravity acceleration. Defaults to 9.806
440
- """
441
-
442
- # Validate direction
453
+
443
454
  valid_directions = ["X", "Y", "Z", "XY", "YZ", "XZ", "XYZ"]
444
455
  if dir not in valid_directions:
445
- dir = "XYZ" # Default to XYZ if invalid
456
+ dir = "XYZ"
446
457
 
447
- # Ensure load_case is a list
448
458
  if not isinstance(load_case, list):
449
459
  load_case = [load_case]
450
460
 
451
- # Handle load_factor - ensure it matches load_case length
452
461
  if load_factor is None:
453
462
  load_factor = [1.0] * len(load_case)
454
463
  elif not isinstance(load_factor, list):
455
464
  load_factor = [load_factor]
456
465
 
457
- # Pad load_factor with 1.0 if shorter than load_case
458
466
  while len(load_factor) < len(load_case):
459
467
  load_factor.append(1.0)
460
468
 
461
- # Check if load cases exist - give warning if not
462
469
  for case in load_case:
463
470
  chk = 0
464
471
  for i in Load_Case.cases:
@@ -482,8 +489,7 @@ class Load:
482
489
  def json(cls):
483
490
  json_data = {"Assign": {}}
484
491
 
485
- for load_obj in enumerate(cls.data):
486
- # Create vLC array with load case names and factors
492
+ for idx, load_obj in enumerate(cls.data, start=1):
487
493
  vlc_array = []
488
494
  for i, case_name in enumerate(load_obj.LOAD_CASE):
489
495
  vlc_array.append({
@@ -491,7 +497,7 @@ class Load:
491
497
  "FACTOR": load_obj.LOAD_FACTOR[i]
492
498
  })
493
499
 
494
- json_data["Assign"]["1"] = {
500
+ json_data["Assign"][str(idx)] = {
495
501
  "DIR": load_obj.DIR,
496
502
  "bNODAL": load_obj.NODAL,
497
503
  "bBEAM": load_obj.BEAM,
@@ -500,7 +506,7 @@ class Load:
500
506
  "GRAV": load_obj.GRAVITY,
501
507
  "vLC": vlc_array
502
508
  }
503
-
509
+
504
510
  return json_data
505
511
 
506
512
  @classmethod
@@ -523,15 +529,13 @@ class Load:
523
529
 
524
530
  if response != {'message': ''}:
525
531
  for key, item_data in response.get('LTOM', {}).items():
526
- # Extract load cases and factors from vLC array
527
532
  load_cases = []
528
533
  load_factors = []
529
534
 
530
- for lc_item in item_data.get('vLC'):
535
+ for lc_item in item_data.get('vLC', []):
531
536
  load_cases.append(lc_item.get('LCNAME'))
532
537
  load_factors.append(lc_item.get('FACTOR'))
533
538
 
534
- # Create LoadToMass object
535
539
  Load.LoadToMass(
536
540
  dir=item_data.get('DIR'),
537
541
  load_case=load_cases,
@@ -543,6 +547,7 @@ class Load:
543
547
  gravity=item_data.get('GRAV')
544
548
  )
545
549
 
550
+
546
551
  #-----------------------------------------------------------NodalMass-----------------
547
552
  #21NodalMass
548
553
 
@@ -201,7 +201,7 @@ class Tendon:
201
201
  Tendon.Property.create()
202
202
  if Tendon.Profile.profiles !=[]:
203
203
  Tendon.Profile.create()
204
- if Tendon.Prestress.load !=[]:
204
+ if Tendon.Prestress.loads !=[]:
205
205
  Tendon.Prestress.create()
206
206
 
207
207
  class Relaxation:
@@ -880,10 +880,9 @@ class Tendon:
880
880
 
881
881
 
882
882
  class Prestress:
883
- """Creates node loads and converts to JSON format.
884
- Example: Load_Node(101, "LC1", "Group1", FZ = 10)
883
+ """Prestress Loading for Tendons.
885
884
  """
886
- load = []
885
+ loads = []
887
886
  ids = []
888
887
  def __init__(self, profile_name, load_case, load_group = "", prestress_type = "STRESS", jack_step = "BEGIN", jack_begin = 0, jack_end=0, grouting_stage = 0, id = 0):
889
888
 
@@ -904,7 +903,7 @@ class Tendon:
904
903
  if jack_step not in ['BEGIN' , 'END' , 'BOTH']: jack_step = 'BEGIN'
905
904
 
906
905
  self.TDN_ID = 0
907
- if id == 0: id = len(Tendon.Prestress.load) + 1
906
+ if id == 0: id = len(Tendon.Prestress.loads) + 1
908
907
  self.ID = id
909
908
  else:
910
909
  self.TDN_ID = -id//100000
@@ -924,14 +923,14 @@ class Tendon:
924
923
 
925
924
 
926
925
 
927
- Tendon.Prestress.load.append(self)
926
+ Tendon.Prestress.loads.append(self)
928
927
  Tendon.Prestress.ids.append(self.ID)
929
928
 
930
929
 
931
930
  @classmethod
932
931
  def json(cls):
933
932
  json = {"Assign": {}}
934
- for self in cls.load:
933
+ for self in cls.loads:
935
934
 
936
935
  # Finding Tendon ID
937
936
  tdn_id = self.TDN_ID
@@ -943,7 +942,7 @@ class Tendon:
943
942
  tdn_check=1
944
943
  break
945
944
  if not tdn_check:
946
- print(f'⚠️ "{self.TDN_NAME}" tendon name is not found for Prestress load application. Prestress load skipped.\n📑 Try Tendon.Profile.sync() to retrieve Profile Names first')
945
+ print(f'⚠️ "{self.TDN_NAME}" Tendon name is not found for Prestress load application. Prestress load skipped.\n📑 Try Tendon.Profile.sync() to retrieve Profile Names first')
947
946
  continue
948
947
 
949
948
 
@@ -973,12 +972,12 @@ class Tendon:
973
972
 
974
973
  @classmethod
975
974
  def delete(cls):
976
- cls.load=[]
975
+ cls.loads=[]
977
976
  return MidasAPI("DELETE", "/db/TDPL")
978
977
 
979
978
  @classmethod
980
979
  def sync(cls):
981
- cls.load = []
980
+ cls.loads = []
982
981
  a = cls.get()
983
982
  if a != {'message': ''}:
984
983
  for i in a['TDPL'].keys():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: midas_civil
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Python library for MIDAS Civil NX
5
5
  Author: Sumit Shekhar
6
6
  Author-email: sumit.midasit@gmail.com
@@ -5,7 +5,7 @@ with open('README.md','r') as f:
5
5
 
6
6
 
7
7
  setup(name='midas_civil',
8
- version='0.2.0',
8
+ version='0.2.2',
9
9
  description='Python library for MIDAS Civil NX',
10
10
  author='Sumit Shekhar',
11
11
  author_email='sumit.midasit@gmail.com',
File without changes
File without changes
File without changes