Skip to content
Snippets Groups Projects
Unverified Commit 160583b7 authored by jlaura's avatar jlaura Committed by GitHub
Browse files

Fixes #584 (#614)

* Fixes #584

* Updates CHANGELOG

* Updates for comments

* Update with different exception throwing logic
parent 183f6b86
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,7 @@ release.
### Fixed
- `update_from_jigsaw` failures due to stale code. Now uses a conntext on the engine to ensure closure
- Fixes errors where reference measure index was being incorrectly tracked when placing measures would fail [#606](https://github.com/USGS-Astrogeology/autocnet/issues/606)
- Fixed #584 where importing autocnet fails on kalasiris imports by wrapping the import in a try accept.
## [0.6.0]
......
......@@ -15,10 +15,14 @@ from collections import abc
from numbers import Number
import numpy as np
try:
import kalasiris as isis
import pvl
except Exception as exception:
from autocnet.utils.utils import FailedImport
isis = FailedImport(exception)
import kalasiris as kal
import pvl
isis2np_types = {
"UnsignedByte" : "uint8",
......@@ -48,7 +52,7 @@ def get_isis_special_pixels(arr):
"""
isis_dtype = np2isis_types[str(arr.dtype)]
sp_pixels = getattr(kal.specialpixels, isis_dtype)
sp_pixels = getattr(isis.specialpixels, isis_dtype)
null = np.argwhere(arr==sp_pixels.Null)
lrs = np.argwhere(arr==sp_pixels.Lrs)
......
......@@ -15,7 +15,12 @@ from pathlib import Path
import numpy as np
import numpy.testing as npt
try:
import kalasiris as isis
except Exception as exception:
from autocnet.utils.utils import FailedImport
isis = FailedImport(exception)
from autocnet.spatial import isis as si
......
......@@ -20,6 +20,13 @@ from shapely import geometry
from shapely.geometry import MultiPoint
from shapely.ops import cascaded_union, polygonize
class FailedImport():
def __init__(self, exception):
self.exception = exception
def __getattr__(self, name: str):
raise self.exception
def tile(array_size, tilesize=1000, overlap=500):
stepsize = tilesize - overlap
if stepsize < 0:
......
......@@ -25,7 +25,11 @@ import numpy as np
from affine import Affine
try:
import kalasiris as isis
except:
from autocnet.utils.utils import FailedImport
isis = FailedImport()
import warnings
warnings.simplefilter("ignore")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment