Skip to content

Deprecate calling the BaseGeometry constructor + EmptyGeometry class#1303

Merged
jorisvandenbossche merged 4 commits intoshapely:mainfrom
jorisvandenbossche:deprecate-base-class-construction
Mar 31, 2022
Merged

Deprecate calling the BaseGeometry constructor + EmptyGeometry class#1303
jorisvandenbossche merged 4 commits intoshapely:mainfrom
jorisvandenbossche:deprecate-base-class-construction

Conversation

@jorisvandenbossche
Copy link
Copy Markdown
Member

Closes #1022

All the geometry subclasses can now properly create an empty geometry when called with no input (eg Point(), Polygon()). So I personally don't see a good reason why people should do BaseGeometry(), while this is creating an empty geometry collection, so GeometryCollection() is more explicit.
See #1022 for some more argumentation.

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 4, 2022

Pull Request Test Coverage Report for Build 2071227143

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 81.139%

Totals Coverage Status
Change from base Build 1895159440: 0.01%
Covered Lines: 2065
Relevant Lines: 2545

💛 - Coveralls

@mwtoews
Copy link
Copy Markdown
Member

mwtoews commented Feb 7, 2022

Shouldn't this raise ShapelyDeprecationWarning (which is a subclass of FutureWarning)?

@jorisvandenbossche
Copy link
Copy Markdown
Member Author

That's fine for me as well (I wasn't sure we were going to use ShapelyDeprecationWarning just for the 2.0 release, or whether we would keep using that class for other deprecations in the future as well, but either way is fine).

@jorisvandenbossche
Copy link
Copy Markdown
Member Author

The black installation issue is getting fixed in #1355

@jorisvandenbossche jorisvandenbossche merged commit fe67cd4 into shapely:main Mar 31, 2022
@jorisvandenbossche jorisvandenbossche deleted the deprecate-base-class-construction branch March 31, 2022 13:22
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 8, 2024

Pull Request Test Coverage Report for Build 1797393911

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+2.9%) to 83.969%

Totals Coverage Status
Change from base Build 1736827466: 2.9%
Covered Lines: 2200
Relevant Lines: 2620

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shapely 2.0: deprecate BaseGeometry() and EmptyGeometry() ?

4 participants