Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien Morais <[email protected]>
  • Loading branch information
Samuelopez-ansys and SMoraisAnsys authored Jan 31, 2025
1 parent bf74307 commit ce8e519
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ansys/aedt/core/modeler/advanced_cad/oms.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import osmnx as ox

except ImportError: # pragma: no cover
warnings.warn("OpenStreetMap Reader requires osmnx extra packages.\n" "Install with \n\npip install osmnx")
warnings.warn("OpenStreetMap Reader requires osmnx extra package.\n" "Install with \n\npip install osmnx")

ZONE_LETTERS = "CDEFGHJKLMNPQRSTUVWXX"

Expand Down Expand Up @@ -495,10 +495,9 @@ def get_elevation(
i = percent_symbol2 + percent_symbol1 + " " + str(percent_complete) + "% "
logger.info(f"\rPercent Complete:{i}")

zone_letter = None
if -80 <= latitude <= 84:
zone_letter = ZONE_LETTERS[int(latitude + 80) >> 3]

Check warning on line 500 in src/ansys/aedt/core/modeler/advanced_cad/oms.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/advanced_cad/oms.py#L498-L500

Added lines #L498 - L500 were not covered by tests
else:
zone_letter = None

zone_number = int((longitude + 180) / 6) + 1
if 56 <= latitude < 64 and 3 <= longitude < 12:
Expand Down Expand Up @@ -548,7 +547,6 @@ def convert_latlon_to_utm(latitude: float, longitude: float, zone_letter: str =
raise ValueError("Latitude out of range: must be between -80 degrees and 84 degrees.")
if longitude < -180.0 or longitude > 180.0:
raise ValueError("Longitude out of range: must be between -180 degrees and 180 degrees.")

if zone_letter is not None and zone_letter.upper() not in ZONE_LETTERS:
raise ValueError("Zone letter out of range.")

Expand Down

0 comments on commit ce8e519

Please sign in to comment.