xslope 0.1.3__tar.gz → 0.1.5__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.3
3
+ Version: 0.1.5
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.3"
2
+ __version__ = "0.1.5"
3
3
 
4
4
 
@@ -25,12 +25,32 @@ 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
+ error_repr = repr(e)
30
+ # Check for OpenGL library issues (common in Colab/headless environments)
31
+ # Check both str() and repr() to catch all variations, and check exception args
32
+ error_text = error_msg + " " + error_repr
33
+ if hasattr(e, 'args') and e.args:
34
+ error_text += " " + " ".join(str(arg) for arg in e.args)
35
+ if ("libGL" in error_text or "libGLU" in error_text):
36
+ help_msg = (
37
+ "gmsh is required for mesh generation but could not be imported due to missing OpenGL libraries. "
38
+ "This is common in headless environments like Google Colab.\n\n"
39
+ "To fix this in Google Colab, install the required system libraries first:\n"
40
+ " !apt-get update && apt-get install -y libgl1-mesa-glx libglu1-mesa\n"
41
+ "Then install gmsh:\n"
42
+ " !pip install gmsh\n\n"
43
+ "For other headless environments, install the appropriate OpenGL libraries for your system.\n"
44
+ f"Original error: {e}"
45
+ )
46
+ else:
47
+ help_msg = (
48
+ "gmsh is required for mesh generation but could not be imported. "
49
+ "If you only need limit equilibrium analysis, you can ignore this. "
50
+ "To use FEM features, install gmsh: pip install gmsh\n"
51
+ f"Original error: {e}"
52
+ )
53
+ raise ImportError(help_msg) from e
34
54
  return _gmsh
35
55
 
36
56
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: xslope
3
- Version: 0.1.3
3
+ Version: 0.1.5
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
File without changes
File without changes