xslope 0.1.2__tar.gz → 0.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: xslope
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Slope stability analysis (limit equilibrium and FEM) in Python.
5
5
  Author: Norman L. Jones
6
6
  Project-URL: Homepage, https://github.com/njones61/xslope
@@ -1,4 +1,4 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "0.1.2"
2
+ __version__ = "0.1.4"
3
3
 
4
4
 
@@ -564,7 +564,13 @@ def load_slope_data(filepath):
564
564
  # === VALIDATION ===
565
565
 
566
566
  circular = len(circles) > 0
567
- if not circular and len(non_circ) == 0:
567
+ # Check if this is a seepage-only analysis (has seepage BCs but no slope stability surfaces)
568
+ has_seepage_bc = (len(seepage_bc.get("specified_heads", [])) > 0 or
569
+ len(seepage_bc.get("exit_face", [])) > 0)
570
+ is_seepage_only = has_seepage_bc and not circular and len(non_circ) == 0
571
+
572
+ # Only require circular/non-circular data if this is NOT a seepage-only analysis
573
+ if not is_seepage_only and not circular and len(non_circ) == 0:
568
574
  raise ValueError("Input must include either circular or non-circular surface data.")
569
575
  if not profile_lines:
570
576
  raise ValueError("Profile lines sheet is empty or invalid.")
@@ -25,12 +25,27 @@ def _get_gmsh():
25
25
  import gmsh
26
26
  _gmsh = gmsh
27
27
  except (ImportError, OSError) as e:
28
- raise ImportError(
29
- "gmsh is required for mesh generation but could not be imported. "
30
- "If you only need limit equilibrium analysis, you can ignore this. "
31
- "To use FEM features, install gmsh: pip install gmsh\n"
32
- f"Original error: {e}"
33
- ) from e
28
+ error_msg = str(e)
29
+ # Check for OpenGL library issues (common in Colab/headless environments)
30
+ if "libGL" in error_msg or "libGLU" in error_msg:
31
+ help_msg = (
32
+ "gmsh is required for mesh generation but could not be imported due to missing OpenGL libraries. "
33
+ "This is common in headless environments like Google Colab.\n\n"
34
+ "To fix this in Google Colab, install the required system libraries first:\n"
35
+ " !apt-get update && apt-get install -y libgl1-mesa-glx libglu1-mesa\n"
36
+ "Then install gmsh:\n"
37
+ " !pip install gmsh\n\n"
38
+ "For other headless environments, install the appropriate OpenGL libraries for your system.\n"
39
+ f"Original error: {e}"
40
+ )
41
+ else:
42
+ help_msg = (
43
+ "gmsh is required for mesh generation but could not be imported. "
44
+ "If you only need limit equilibrium analysis, you can ignore this. "
45
+ "To use FEM features, install gmsh: pip install gmsh\n"
46
+ f"Original error: {e}"
47
+ )
48
+ raise ImportError(help_msg) from e
34
49
  return _gmsh
35
50
 
36
51
 
@@ -416,6 +416,8 @@ def plot_non_circ(ax, non_circ):
416
416
  Returns:
417
417
  None
418
418
  """
419
+ if not non_circ or len(non_circ) == 0:
420
+ return
419
421
  xs, ys = zip(*non_circ)
420
422
  ax.plot(xs, ys, 'r--', label='Non-Circular Surface')
421
423
 
@@ -744,7 +746,7 @@ def plot_inputs(slope_data, title="Slope Geometry and Inputs", width=12, height=
744
746
 
745
747
  if slope_data['circular']:
746
748
  plot_circles(ax, slope_data)
747
- else:
749
+ elif slope_data.get('non_circ') and len(slope_data['non_circ']) > 0:
748
750
  plot_non_circ(ax, slope_data['non_circ'])
749
751
 
750
752
  # Handle material table display
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: xslope
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Slope stability analysis (limit equilibrium and FEM) in Python.
5
5
  Author: Norman L. Jones
6
6
  Project-URL: Homepage, https://github.com/njones61/xslope
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes