Skip to content

Commit

Permalink
revert to dd66ffe to ensure proj installation is being tested, issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
lassefolkersen committed May 7, 2024
1 parent 0fd6488 commit 1be4a85
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions tests/test_planet.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ def test_convert_to_rgba(solar_system, tmpdir):
assert rgba_image.getpixel((i, 0)) == (0, 0, 0, 0) # Assuming image width is 1080




def test_sphere_to_plane_total(solar_system, tmpdir):
# Pick an example planet, like Earth
planet_instance = solar_system.planets["earth"]
Expand All @@ -278,26 +280,16 @@ def test_sphere_to_plane_total(solar_system, tmpdir):
northern_inclination = 0
projection_scaling = 360

try:
# Call the sphere_to_plane_total function
projection_coordinates = planet_instance.sphere_to_plane_total(sphere_coordinates, eastern_inclination, northern_inclination, projection_scaling)

# Assertions
assert len(projection_coordinates) == len(sphere_coordinates) # Check if the number of projection coordinates matches the number of sphere coordinates

# Print out the projection coordinates for examination
print("Projection Coordinates:")
for i, coord in enumerate(projection_coordinates):
print(f"Sphere Coordinate {i+1}: {sphere_coordinates[i]} -> Projection Coordinate: {coord}")
# Call the sphere_to_plane_total function
projection_coordinates = planet_instance.sphere_to_plane_total(sphere_coordinates, eastern_inclination, northern_inclination, projection_scaling)

# Assertions
assert len(projection_coordinates) == len(sphere_coordinates) # Check if the number of projection coordinates matches the number of sphere coordinates

except Exception as e:
error_message = str(e)
if 'proj' in error_message.lower():
print("Projection error occurred. This is expected for now on non-windows machines. See issue #9.")
return True
else:
raise e
# Print out the projection coordinates for examination
print("Projection Coordinates:")
for i, coord in enumerate(projection_coordinates):
print(f"Sphere Coordinate {i+1}: {sphere_coordinates[i]} -> Projection Coordinate: {coord}")



Expand Down

0 comments on commit 1be4a85

Please sign in to comment.