We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8278de commit 3337d79Copy full SHA for 3337d79
turn_by_turn/madng.py
@@ -182,10 +182,12 @@ def write_tbt(output_path: str | Path, tbt_data: TbtData) -> None:
182
Raises:
183
ImportError: If the ``tfs-pandas`` package is not installed.
184
"""
185
- if not tfs:
+ try:
186
+ import tfs
187
+ except ImportError as e:
188
raise ImportError(
189
"The 'tfs' package is required to write MAD-NG TFS files. Install it with: pip install 'turn_by_turn[madng]'"
- )
190
+ ) from e
191
192
planes = [plane.lower() for plane in TransverseData.fieldnames()] # x, y
193
plane_dfs = {plane: [] for plane in planes}
0 commit comments