Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ release.
- Reduced linescan ISD ephemeris sampling from one-per-line to every 10th line for images with 1000+ lines, significantly reducing ISD file sizes and load times for large sensors. Configurable via `reduction` and `ephem_sample_rate` props. [#677](https://github.com/DOI-USGS/ale/pull/677)
- Throw error when input file does not exist. [#692](https://github.com/DOI-USGS/ale/pull/692)

### Removed
- Removed isis_formatter and usgscsm_formatter. Ale formatter will always be used. [#698](https://github.com/DOI-USGS/ale/pull/698)

### Fixed
- Fixed Eigen 5.x compatibility by removing version constraint in CMakeLists.txt [#677](https://github.com/DOI-USGS/ale/pull/677)
- Fixed C++ load(s) call failing when called again after throwing an error [#6967](https://github.com/DOI-USGS/ale/pull/696)
Expand Down
29 changes: 14 additions & 15 deletions ale/drivers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from ale.base import WrongInstrumentException, WrongLabelTypeException
import logging

from ale.formatters.usgscsm_formatter import to_usgscsm
from ale.formatters.isis_formatter import to_isis
from ale.formatters.formatter import to_isd
from ale.base.data_isis import IsisSpice
from ale.base.data_naif import NaifSpice
Expand All @@ -32,10 +30,6 @@
__all__ = [driver for driver in __all__ if driver not in __disabled_drivers__]
__driver_modules__ = [importlib.import_module('.'+m, package='ale.drivers') for m in __all__]

__formatters__ = {'usgscsm': to_usgscsm,
'isis': to_isis,
'ale' : to_isd}

def sort_drivers(drivers=[]):
return list(sorted(set(drivers), key=lambda x:IsisSpice in x.__bases__, reverse=False))

Expand Down Expand Up @@ -84,10 +78,10 @@ def load(label, props={}, formatter='ale', verbose=False, only_isis_spice=False,
For example, Drivers that use the NaifSpice mix-in use the 'kernels'
property to specify an explicit set of kernels and load order.

formatter : {'ale', 'isis', 'usgscsm'}
Output format for the ISD. As of 0.8.0, it is recommended that
the `ale` formatter is used. The `isis` and `usgscsm` formatters
are retrained for backwards compatibility.
formatter : {'ale'} ('isis', and 'usgscsm' are deprecated)
Output format for the ISD. As of 2.0.0, the
`ale` formatter is always used. The parameter is retained
for backwards compatibility.
Comment on lines +81 to +84

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good but a breaking change like this would require a version tick to ALE 2.0.0. In ISIS we usually hold any breaking change for the yearly release, I don't know what we should do for ALE. With the spiceql changes and the gdal additions we could likely do a 2.0.0. @Kelvinrr thoughts?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably hold off on this for this reason. At least we should see if there are more API breaking changes we can pile on.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code removed is ancient and not used by anybody. Likely ALE 2.0.0 bump is needed simply because of adding the ShadowCam lens distortion which breaks the enums.

I'd say the risk of this is very low. Also, likely next ISIS need to have a hard pin to this as well, and with usgscsm and spiceql too, all because of ShadowCam. There's no good reason for the user to want independent versions for these.


verbose : bool
If True, displays debug output specifying which drivers were
Expand All @@ -106,18 +100,23 @@ def load(label, props={}, formatter='ale', verbose=False, only_isis_spice=False,
dict
The ISD as a dictionary
"""

logger_level = logger.getEffectiveLevel()
if verbose:
logger.setLevel(logging.DEBUG)

# usgscsm and isis formatter deprecation warning
if isinstance(formatter, str):
formatter = __formatters__[formatter]
if str is not 'ale':
logger.warning("'ale' is the only available formatter, and will always be used. All other formatters are deprecated.")

if isinstance(props, str):
if props in ("", "null"):
props = {}
else:
props = json.loads(props)

logger_level = logger.getEffectiveLevel()
if verbose:
logger.setLevel(logging.DEBUG)


driver_mask = [only_isis_spice, only_naif_spice]
class_list = [IsisSpice, NaifSpice]
Expand Down Expand Up @@ -184,7 +183,7 @@ def load(label, props={}, formatter='ale', verbose=False, only_isis_spice=False,
# get instrument_id to force early failure
res.instrument_id
with res as driver:
isd = formatter(driver)
isd = to_isd(driver) # if adding other formatters in the future, set in place of 'to_isd'
if 'attach_kernels' in props and props['attach_kernels'] is False and 'kernels' in isd:
del isd['kernels']
if verbose:
Expand Down
2 changes: 1 addition & 1 deletion ale/formatters/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import usgscsm_formatter, isis_formatter
from . import formatter
118 changes: 0 additions & 118 deletions ale/formatters/isis_formatter.py

This file was deleted.

187 changes: 0 additions & 187 deletions ale/formatters/usgscsm_formatter.py

This file was deleted.

Loading
Loading