topologicpy 0.7.37__py3-none-any.whl → 0.7.38__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.
topologicpy/Graph.py CHANGED
@@ -1289,7 +1289,7 @@ class Graph:
1289
1289
  return values
1290
1290
 
1291
1291
  @staticmethod
1292
- def ByAdjacencyMatrixCSVPath(path):
1292
+ def ByAdjacencyMatrixCSVPath(path: str, dictionaries: list = None, silent: bool = False):
1293
1293
  """
1294
1294
  Returns graphs according to the input path. This method assumes the CSV files follow an adjacency matrix schema.
1295
1295
 
@@ -1297,6 +1297,11 @@ class Graph:
1297
1297
  ----------
1298
1298
  path : str
1299
1299
  The file path to the adjacency matrix CSV file.
1300
+ dictionaries : list , optional
1301
+ A list of dictionaries to assign to the vertices of the graph. This list should be in
1302
+ the same order and of the same length as the rows in the adjacency matrix.
1303
+ silent : bool , optional
1304
+ If set to True, no warnings or error messages are displayed. The default is False.
1300
1305
 
1301
1306
  Returns
1302
1307
  -------
@@ -1310,10 +1315,10 @@ class Graph:
1310
1315
 
1311
1316
  # Convert DataFrame to a nested list
1312
1317
  adjacency_matrix = adjacency_matrix_df.values.tolist()
1313
- return Graph.ByAdjacencyMatrix(adjacencyMatrix=adjacency_matrix)
1318
+ return Graph.ByAdjacencyMatrix(adjacencyMatrix=adjacency_matrix, dictionaries=dictionaries, silent=silent)
1314
1319
 
1315
1320
  @staticmethod
1316
- def ByAdjacencyMatrix(adjacencyMatrix, xMin=-0.5, yMin=-0.5, zMin=-0.5, xMax=0.5, yMax=0.5, zMax=0.5):
1321
+ def ByAdjacencyMatrix(adjacencyMatrix, dictionaries = None, xMin=-0.5, yMin=-0.5, zMin=-0.5, xMax=0.5, yMax=0.5, zMax=0.5, silent=False):
1317
1322
  """
1318
1323
  Returns graphs according to the input folder path. This method assumes the CSV files follow DGL's schema.
1319
1324
 
@@ -1321,18 +1326,23 @@ class Graph:
1321
1326
  ----------
1322
1327
  adjacencyMatrix : list
1323
1328
  The adjacency matrix expressed as a nested list of 0s and 1s.
1324
- xMin : float, optional
1329
+ dictionaries : list , optional
1330
+ A list of dictionaries to assign to the vertices of the graph. This list should be in
1331
+ the same order and of the same length as the rows in the adjacency matrix.
1332
+ xMin : float , optional
1325
1333
  The desired minimum value to assign for a vertex's X coordinate. The default is -0.5.
1326
- yMin : float, optional
1334
+ yMin : float , optional
1327
1335
  The desired minimum value to assign for a vertex's Y coordinate. The default is -0.5.
1328
- zMin : float, optional
1336
+ zMin : float , optional
1329
1337
  The desired minimum value to assign for a vertex's Z coordinate. The default is -0.5.
1330
- xMax : float, optional
1338
+ xMax : float , optional
1331
1339
  The desired maximum value to assign for a vertex's X coordinate. The default is 0.5.
1332
- yMax : float, optional
1340
+ yMax : float , optional
1333
1341
  The desired maximum value to assign for a vertex's Y coordinate. The default is 0.5.
1334
- zMax : float, optional
1342
+ zMax : float , optional
1335
1343
  The desired maximum value to assign for a vertex's Z coordinate. The default is 0.5.
1344
+ silent : bool , optional
1345
+ If set to True, no warnings or error messages are displayed. The default is False.
1336
1346
 
1337
1347
  Returns
1338
1348
  -------
@@ -1342,16 +1352,25 @@ class Graph:
1342
1352
  """
1343
1353
  from topologicpy.Vertex import Vertex
1344
1354
  from topologicpy.Edge import Edge
1355
+ from topologicpy.Topology import Topology
1345
1356
  import random
1346
1357
 
1347
1358
  if not isinstance(adjacencyMatrix, list):
1348
1359
  print("Graph.ByAdjacencyMatrix - Error: The input adjacencyMatrix parameter is not a valid list. Returning None.")
1349
1360
  return None
1361
+ if isinstance(dictionaries, list):
1362
+ if not len(dictionaries) == len(adjacencyMatrix):
1363
+ if not silent:
1364
+ print("Graph.ByAdjacencyMatrix - Error: The length of the dictionaries list and the adjacency matrix are different. Returning None.")
1365
+ return None
1366
+
1350
1367
  # Add vertices with random coordinates
1351
1368
  vertices = []
1352
1369
  for i in range(len(adjacencyMatrix)):
1353
1370
  x, y, z = random.uniform(xMin,xMax), random.uniform(yMin,yMax), random.uniform(zMin,zMax)
1354
- vertices.append(Vertex.ByCoordinates(x, y, z))
1371
+ v = Vertex.ByCoordinates(x, y, z)
1372
+ v = Topology.SetDictionary(v, dictionaries[i])
1373
+ vertices.append(v)
1355
1374
 
1356
1375
  # Create the graph using vertices and edges
1357
1376
  if len(vertices) == 0:
topologicpy/Sun.py CHANGED
@@ -132,7 +132,6 @@ class Sun():
132
132
  -------
133
133
  datetime
134
134
  The datetime of the summer solstice
135
-
136
135
  """
137
136
  import os
138
137
  import warnings
@@ -173,7 +172,6 @@ class Sun():
173
172
  -------
174
173
  datetime
175
174
  The datetime of the summer solstice
176
-
177
175
  """
178
176
  import os
179
177
  import warnings
@@ -216,7 +214,6 @@ class Sun():
216
214
  -------
217
215
  float
218
216
  The azimuth angle.
219
-
220
217
  """
221
218
  import os
222
219
  import warnings
@@ -263,7 +260,6 @@ class Sun():
263
260
  -------
264
261
  float
265
262
  The altitude angle.
266
-
267
263
  """
268
264
  import os
269
265
  import warnings
@@ -310,8 +306,8 @@ class Sun():
310
306
  -------
311
307
  datetime
312
308
  The Sunrise datetime.
313
-
314
309
  """
310
+
315
311
  import os
316
312
  import warnings
317
313
  try:
@@ -355,8 +351,8 @@ class Sun():
355
351
  -------
356
352
  datetime
357
353
  The Sunset datetime.
358
-
359
354
  """
355
+
360
356
  import os
361
357
  import warnings
362
358
  try:
@@ -383,7 +379,7 @@ class Sun():
383
379
  return sunset
384
380
 
385
381
  @staticmethod
386
- def Vector(latitude: float, longitude: float, date, north: float = 0, mantissa: int = 6, tolerance: float = 0.0001):
382
+ def Vector(latitude, longitude, date, north=0):
387
383
  """
388
384
  Returns the Sun as a vector.
389
385
 
@@ -402,12 +398,11 @@ class Sun():
402
398
  -------
403
399
  list
404
400
  The sun vector pointing from the location of the sun towards the origin.
405
-
406
401
  """
407
402
  from topologicpy.Vector import Vector
408
403
  azimuth = Sun.Azimuth(latitude=latitude, longitude=longitude, date=date)
409
404
  altitude = Sun.Altitude(latitude=latitude, longitude=longitude, date=date)
410
- return Vector.ByAzimuthAltitude(azimuth=azimuth, altitude=altitude, north=north, reverse=True, mantissa=mantissa, tolerance=tolerance)
405
+ return Vector.ByAzimuthAltitude(azimuth=azimuth, altitude=altitude, north=north, reverse=True)
411
406
 
412
407
  @staticmethod
413
408
  def Position(latitude, longitude, date, origin=None, radius=0.5, north=0, mantissa=6):
@@ -422,7 +417,7 @@ class Sun():
422
417
  The input longitude. See https://en.wikipedia.org/wiki/Longitude.
423
418
  date : datetime
424
419
  The input datetime.
425
- origin : topologic_core.Vertex , optional
420
+ origin : topologic.Vertex , optional
426
421
  The desired origin of the world. If set to None, the origin will be set to (0,0,0). The default is None.
427
422
  radius : float , optional
428
423
  The desired radius of the sun orbit. The default is 0.5.
@@ -431,14 +426,13 @@ class Sun():
431
426
  mantissa : int , optional
432
427
  The desired length of the mantissa. The default is 6.
433
428
 
429
+
434
430
  Returns
435
431
  -------
436
- topologic_core.Vertex
432
+ topologic.Vertex
437
433
  The sun represented as a vertex.
438
-
439
434
  """
440
435
  from topologicpy.Vertex import Vertex
441
-
442
436
  sun_v = Sun.Vertex(latitude=latitude, longitude=longitude, date=date, origin=origin, radius=radius, north=north)
443
437
  return Vertex.Coordinates(sun_v, mantissa=mantissa)
444
438
 
@@ -455,7 +449,7 @@ class Sun():
455
449
  The input longitude. See https://en.wikipedia.org/wiki/Longitude.
456
450
  date : datetime
457
451
  The input datetime.
458
- origin : topologic_core.Vertex , optional
452
+ origin : topologic.Vertex , optional
459
453
  The desired origin of the world. If set to None, the origin will be set to (0,0,0). The default is None.
460
454
  radius : float , optional
461
455
  The desired radius of the sun orbit. The default is 0.5.
@@ -464,14 +458,14 @@ class Sun():
464
458
 
465
459
  Returns
466
460
  -------
467
- topologic_core.Vertex
461
+ topologic.Vertex
468
462
  The sun represented as a vertex.
469
463
  """
470
464
  from topologicpy.Vertex import Vertex
471
465
  from topologicpy.Topology import Topology
472
466
  from topologicpy.Vector import Vector
473
467
 
474
- if not Topology.IsInstance(origin, "Vertex"):
468
+ if origin == None:
475
469
  origin = Vertex.Origin()
476
470
  vector = Vector.Reverse(Sun.Vector(latitude=latitude, longitude=longitude, date=date, north=north))
477
471
  sun_v = Topology.TranslateByDirectionDistance(origin, direction=vector, distance=radius)
@@ -490,7 +484,7 @@ class Sun():
490
484
  The input longitude. See https://en.wikipedia.org/wiki/Longitude.
491
485
  date : datetime
492
486
  The input datetime.
493
- origin : topologic_core.Vertex , optional
487
+ origin : topologic.Vertex , optional
494
488
  The desired origin of the world. If set to None, the origin will be set to (0,0,0). The default is None.
495
489
  radius : float , optional
496
490
  The desired radius of the sun orbit. The default is 0.5.
@@ -499,7 +493,7 @@ class Sun():
499
493
 
500
494
  Returns
501
495
  -------
502
- topologic_core.Edge
496
+ topologic.Edge
503
497
  The sun represented as an edge pointing from the location of the sun towards the origin.
504
498
  """
505
499
  from topologicpy.Vertex import Vertex
@@ -507,7 +501,7 @@ class Sun():
507
501
  from topologicpy.Topology import Topology
508
502
  from topologicpy.Vector import Vector
509
503
 
510
- if not Topology.IsInstance(origin, "Vertex"):
504
+ if origin == None:
511
505
  origin = Vertex.Origin()
512
506
  vector = Vector.Reverse(Sun.Vector(latitude=latitude, longitude=longitude, date=date, north=north))
513
507
  sun_v = Topology.TranslateByDirectionDistance(origin, direction=vector, distance=radius)
@@ -533,7 +527,7 @@ class Sun():
533
527
  The desired end time to compute the sun location. If set to None, Sun.Sunset is used. The default is None.
534
528
  interval : int , optional
535
529
  The interval in minutes to compute the sun location. The default is 60.
536
- origin : topologic_core.Vertex , optional
530
+ origin : topologic.Vertex , optional
537
531
  The desired origin of the world. If set to None, the origin will be set to (0,0,0). The default is None.
538
532
  radius : float , optional
539
533
  The desired radius of the sun orbit. The default is 0.5.
@@ -577,7 +571,7 @@ class Sun():
577
571
  The desired end time to compute the sun location. If set to None, Sun.Sunset is used. The default is None.
578
572
  interval : int , optional
579
573
  The interval in minutes to compute the sun location. The default is 60.
580
- origin : topologic_core.Vertex , optional
574
+ origin : topologic.Vertex , optional
581
575
  The desired origin of the world. If set to None, the origin will be set to (0,0,0). The default is None.
582
576
  radius : float , optional
583
577
  The desired radius of the sun orbit. The default is 0.5.
@@ -589,16 +583,14 @@ class Sun():
589
583
 
590
584
  Returns
591
585
  -------
592
- topologic_core.Wire
586
+ topologic.Wire
593
587
  The sun path represented as a wire.
594
-
595
588
  """
596
589
  from topologicpy.Vertex import Vertex
597
590
  from topologicpy.Wire import Wire
598
- from topologicpy.Dictionary import Dictionary
599
591
  from topologicpy.Topology import Topology
600
-
601
- if not Topology.IsInstance(origin, "Vertex"):
592
+ from topologicpy.Dictionary import Dictionary
593
+ if origin == None:
602
594
  origin = Vertex.Origin()
603
595
  if startTime == None:
604
596
  startTime = Sun.Sunrise(latitude=latitude, longitude=longitude, date=date)
@@ -641,7 +633,7 @@ class Sun():
641
633
  The desired end day to compute the sun location. The default is 365.
642
634
  interval : int , optional
643
635
  The interval in days to compute the sun location. The default is 5.
644
- origin : topologic_core.Vertex , optional
636
+ origin : topologic.Vertex , optional
645
637
  The desired origin of the world. If set to None, the origin will be set to (0,0,0). The default is None.
646
638
  radius : float , optional
647
639
  The desired radius of the sun orbit. The default is 0.5.
@@ -652,11 +644,9 @@ class Sun():
652
644
  -------
653
645
  list
654
646
  The sun locations represented as a list of vertices.
655
-
656
647
  """
657
648
  from datetime import datetime
658
649
  from datetime import timedelta
659
-
660
650
  def day_of_year_to_datetime(year, day_of_year):
661
651
  # Construct a datetime object for the first day of the year
662
652
  base_date = datetime(year, 1, 1)
@@ -694,7 +684,7 @@ class Sun():
694
684
  The desired end day of the year to compute the sun location. The default is 365.
695
685
  interval : int , optional
696
686
  The interval in days to compute the sun location. The default is 5.
697
- origin : topologic_core.Vertex , optional
687
+ origin : topologic.Vertex , optional
698
688
  The desired origin of the world. If set to None, the origin will be set to (0,0,0). The default is None.
699
689
  radius : float , optional
700
690
  The desired radius of the sun orbit. The default is 0.5.
@@ -706,13 +696,13 @@ class Sun():
706
696
 
707
697
  Returns
708
698
  -------
709
- topologic_core.Wire
699
+ topologic.Wire
710
700
  The sun path represented as a topologic wire.
711
-
712
701
  """
702
+
713
703
  from topologicpy.Wire import Wire
714
- from topologicpy.Dictionary import Dictionary
715
704
  from topologicpy.Topology import Topology
705
+ from topologicpy.Dictionary import Dictionary
716
706
 
717
707
  vertices = Sun.VerticesByHour(latitude=latitude, longitude=longitude, hour=hour,
718
708
  startDay=startDay, endDay=endDay, interval=interval,
@@ -749,7 +739,7 @@ class Sun():
749
739
  The interval in minutes to compute the sun location for the date path. The default is 30.
750
740
  dayInterval : int , optional
751
741
  The interval in days for the hourly path to compute the sun location. The default is 15.
752
- origin : topologic_core.Vertex , optional
742
+ origin : topologic.Vertex , optional
753
743
  The desired origin of the world. If set to None, the origin will be set to (0,0,0). The default is None.
754
744
  radius : float , optional
755
745
  The desired radius of the sun orbit. The default is 0.5.
@@ -776,8 +766,8 @@ class Sun():
776
766
  - 'center' : This is a cross-shape (wire) at the center of the diagram. This is included only if the compass option is set to True.
777
767
  - 'ground' : This is a circle (face) on the ground. It is made of 36 sides. This is included only if
778
768
  the compass option is set to False.
779
-
780
769
  """
770
+
781
771
  from datetime import datetime
782
772
  from datetime import timedelta
783
773
  from topologicpy.Vertex import Vertex
@@ -789,7 +779,7 @@ class Sun():
789
779
  from topologicpy.Topology import Topology
790
780
  from topologicpy.Dictionary import Dictionary
791
781
 
792
- if not Topology.IsInstance(origin, "Vertex"):
782
+ if origin == None:
793
783
  origin = Vertex.Origin()
794
784
 
795
785
  cutter = Cell.Prism(origin=origin, width=radius*4, length=radius*4, height=radius*2)
topologicpy/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.7.37'
1
+ __version__ = '0.7.38'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.7.37
3
+ Version: 0.7.38
4
4
  Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  License: MIT License
@@ -10,7 +10,7 @@ topologicpy/Dictionary.py,sha256=KqJ29YyE23Y3Xc6XmKLSCZXRfBvm-OEOxlMZ4dt-rfM,270
10
10
  topologicpy/Edge.py,sha256=vhYHkobSLGSWV-oe2oJFFDobqFToDyb7s71yQ840AAA,65166
11
11
  topologicpy/EnergyModel.py,sha256=ni0H1JgvLl1-q90yK9Sm1qj5P1fTuidlimEIcwuj6qE,53287
12
12
  topologicpy/Face.py,sha256=SrP7LbOK9wjArYTO2fDVrtxItGXNkCMqmMRNz4-46gA,115473
13
- topologicpy/Graph.py,sha256=ICwFUYLka6tEPMo43I9QAe24ljItMUZOZYL21xpDPIg,392146
13
+ topologicpy/Graph.py,sha256=PnOjkQ6Zp2ykrY3rS21HhPN7R0YNW-7euz1m-wU0YiU,393433
14
14
  topologicpy/Grid.py,sha256=Q-2WNBkvIsJks7pbGkzzkRWVB4fTMYgWipG3lcDXbpE,18496
15
15
  topologicpy/Helper.py,sha256=mLwJmhyc-d-JqW82MBf7JwM91zWHVx8RzOmndPWHm-k,17717
16
16
  topologicpy/Honeybee.py,sha256=vcBECJlgWVjNNdD9ZmjNik_pA1Y_ZNoOorsQb2CiyGA,21965
@@ -20,15 +20,15 @@ topologicpy/Plotly.py,sha256=qMhBMAYoNMsc-cKdNpqM2p9rqAVXWvBNTzmTKw7iU_0,98963
20
20
  topologicpy/Polyskel.py,sha256=4R5_DEdfrmi-4gR6axHNoHTCSAE2TCekOyN8jvb7bHQ,19722
21
21
  topologicpy/Shell.py,sha256=bJ8zu5gj-TSOADR-p3YQ9yLPHFTffnv-29uD5b6Zvuc,79912
22
22
  topologicpy/Speckle.py,sha256=rUS6PCaxIjEF5_fUruxvMH47FMKg-ohcoU0qAUb-yNM,14267
23
- topologicpy/Sun.py,sha256=_gZfVyH0SDLQmmt775UeeAJ_BtwXO1STQnUMV1qkU0s,37161
23
+ topologicpy/Sun.py,sha256=InnKtX8eKwtAgcScuABH6yp0ljmWh5m_fDR4-n3jJMY,36869
24
24
  topologicpy/Topology.py,sha256=Sfw0C5Sd1m3ndLyM_zrCLzegfMd6ytnaK82J_ToK5lQ,366264
25
25
  topologicpy/Vector.py,sha256=WQQUbwrg7VKImtxuBUi2i-FRiPT77WlrzLP05gdXKM8,33079
26
26
  topologicpy/Vertex.py,sha256=EQdVYHmW85_pZdHZB3N8pEi0GiadCCkF3z_oqohA7B0,71161
27
27
  topologicpy/Wire.py,sha256=Ls2ItdNQ_qbC1RUc8bAtGbM5B5A-uShjHdiOFVVwx-8,153711
28
28
  topologicpy/__init__.py,sha256=D7ky87CAQMiS2KE6YLvcTLkTgA2PY7rASe6Z23pjp9k,872
29
- topologicpy/version.py,sha256=ELkwc8QfDXR6OC99fHNSgYmlBjnbBmo_0j-69MXQmNA,23
30
- topologicpy-0.7.37.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
31
- topologicpy-0.7.37.dist-info/METADATA,sha256=ZOohbLJX-LIHwG-aIFZUdZbgYqxppOt5uroiZvyoobU,10916
32
- topologicpy-0.7.37.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
33
- topologicpy-0.7.37.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
34
- topologicpy-0.7.37.dist-info/RECORD,,
29
+ topologicpy/version.py,sha256=UnhU_ln7vUcinj8Cem2quVLc3nZ_d5hPc8CCYOzG0A8,23
30
+ topologicpy-0.7.38.dist-info/LICENSE,sha256=BRNw73R2WdDBICtwhI3wm3cxsaVqLTAGuRwrTltcfxs,1068
31
+ topologicpy-0.7.38.dist-info/METADATA,sha256=yquirb6uoTD1IEJsn62E6VtN1bR3zAVPv_KeA5LGK_o,10916
32
+ topologicpy-0.7.38.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
33
+ topologicpy-0.7.38.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
34
+ topologicpy-0.7.38.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (71.1.0)
2
+ Generator: setuptools (72.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5