Skip to content

Commit

Permalink
deprecate get_fileext (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Nov 20, 2024
1 parent 4d34d0a commit ab0cba5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/363.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate DataModel.get_fileext.
4 changes: 4 additions & 0 deletions src/stdatamodels/model_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,10 @@ def schema(self):
return self._schema

def get_fileext(self):
warnings.warn(
"get_fileext always returns 'fits' and will be removed in an upcoming release",
DeprecationWarning
)
return 'fits'

@property
Expand Down
6 changes: 6 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,9 @@ def find_gen_by_id(object_id):
# many models which would indicate they are difficult to garbage
# collect.
assert len(mids) < 2


def test_get_fileext_deprecation():
m = DataModel()
with pytest.warns(DeprecationWarning):
assert m.get_fileext() == 'fits'

0 comments on commit ab0cba5

Please sign in to comment.