[Django] #25665: alias members of `GEOSGeometry` (`num_points`, `crs`, `get_srid`, `set_srid`) should be deprecated or documented

33 views
Skip to first unread message

Django

unread,
Nov 3, 2015, 4:01:34 AM11/3/15
to django-...@googlegroups.com
#25665: alias members of `GEOSGeometry` (`num_points`, `crs`, `get_srid`,
`set_srid`) should be deprecated or documented
--------------------------------------+--------------------
Reporter: sir-sigurd | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: GIS | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
I'd prefer to deprecate them because I see no benefit in having them, I
think they just litter class namespace.

--
Ticket URL: <https://code.djangoproject.com/ticket/25665>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 3, 2015, 4:01:37 AM11/3/15
to django-...@googlegroups.com
#25665: alias members of `GEOSGeometry` (`num_points`, `crs`, `get_srid`,
`set_srid`) should be deprecated or documented
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by sir-sigurd):

* owner: nobody => sir-sigurd
* needs_better_patch: => 0
* status: new => assigned
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:1>

Django

unread,
Nov 4, 2015, 11:18:20 AM11/4/15
to django-...@googlegroups.com
#25665: alias members of `GEOSGeometry` (`num_points`, `crs`, `get_srid`,
`set_srid`) should be deprecated or documented
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* version: 1.8 => master
* stage: Unreviewed => Accepted


Comment:

I would let `num_points` and `crs`, they make no harm.

I see `get_srid`, `set_srid` as an artifact from the time the property
decorator didn't exist. So +1 to use the modern decorator syntax and
deprecate the get/set methods.

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:2>

Django

unread,
Nov 4, 2015, 1:15:52 PM11/4/15
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses

-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Old description:

> I'd prefer to deprecate them because I see no benefit in having them, I
> think they just litter class namespace.

New description:

--

Comment (by sir-sigurd):

I was motivated to deprecate `num_points` and `crs` because number of
`GEOSGeometry` members looks disturbing for me.
{{{
In [2]: GEOSGeometry.
In [2]: from django.contrib.gis.geos import GEOSGeometry as Geometry

In [3]: Geometry.
Geometry.append Geometry.geojson Geometry.prepared
Geometry.area Geometry.geom_type Geometry.ptr
Geometry.boundary Geometry.geom_typeid Geometry.ptr_type
Geometry.buffer Geometry.get_srid Geometry.relate
Geometry.centroid Geometry.has_cs
Geometry.relate_pattern
Geometry.clone Geometry.hasz Geometry.remove
Geometry.contains Geometry.hex Geometry.reverse
Geometry.convex_hull Geometry.hexewkb Geometry.ring
Geometry.coord_seq Geometry.index Geometry.set_srid
Geometry.count Geometry.insert Geometry.simple
Geometry.crosses Geometry.intersection Geometry.simplify
Geometry.crs Geometry.intersects Geometry.sort
Geometry.difference Geometry.json Geometry.srid
Geometry.dims Geometry.kml Geometry.srs
Geometry.disjoint Geometry.length
Geometry.sym_difference
Geometry.distance Geometry.mro Geometry.touches
Geometry.empty Geometry.normalize Geometry.transform
Geometry.envelope Geometry.num_coords Geometry.union
Geometry.equals Geometry.num_geom Geometry.valid
Geometry.equals_exact Geometry.num_points
Geometry.valid_reason
Geometry.ewkb Geometry.ogr Geometry.within
Geometry.ewkt Geometry.overlaps Geometry.wkb
Geometry.extend Geometry.point_on_surface Geometry.wkt
Geometry.extent Geometry.pop
}}}

I'll change ticket summary because there are also getters/setters for
coordinates of `Point` and probably there are others.

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:3>

Django

unread,
Nov 5, 2015, 3:28:31 AM11/5/15
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by sir-sigurd):

* has_patch: 0 => 1


Comment:

PR -- https://github.com/django/django/pull/5549

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:4>

Django

unread,
Nov 5, 2015, 7:20:27 AM11/5/15
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by claudep):

Looks good, I'll let Tim make the language review.

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:5>

Django

unread,
Nov 18, 2015, 7:12:47 AM11/18/15
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1


Comment:

Left comments for improvement.

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:6>

Django

unread,
Nov 18, 2015, 7:58:40 AM11/18/15
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by sir-sigurd):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:7>

Django

unread,
Nov 18, 2015, 11:50:36 AM11/18/15
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"b7177cc2a422a0183c8f2d56eceb6b9323c6f959" b7177cc]:
{{{
#!CommitTicketReference repository=""
revision="b7177cc2a422a0183c8f2d56eceb6b9323c6f959"
Refs #25665 -- Deprecated getter/setter of GEOSGeometry.srid.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:8>

Django

unread,
Nov 18, 2015, 11:53:20 AM11/18/15
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:9>

Django

unread,
Nov 18, 2015, 12:02:20 PM11/18/15
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"7803f429a4d435623cb7b91dd324d3aadad87380" 7803f42]:
{{{
#!CommitTicketReference repository=""
revision="7803f429a4d435623cb7b91dd324d3aadad87380"
Refs #25665 -- Deprecated getters/setters of Point coordinate properties.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:10>

Django

unread,
Nov 18, 2015, 12:06:49 PM11/18/15
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"7a452c5ce295679307bd81dd9b5f37b3cf762acf" 7a452c5]:
{{{
#!CommitTicketReference repository=""
revision="7a452c5ce295679307bd81dd9b5f37b3cf762acf"
Fixed #25665 -- Deprecated getter/setter of Point.tuple.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:11>

Django

unread,
Jan 17, 2017, 10:09:51 PM1/17/17
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev

Cleanup/optimization | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"19d8e64ac357271e708f6db377975ee85b7e4342" 19d8e64a]:
{{{
#!CommitTicketReference repository=""
revision="19d8e64ac357271e708f6db377975ee85b7e4342"
Refs #25665 -- Removed deprecated getters/setters of Point coordinate
properties.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:13>

Django

unread,
Jan 17, 2017, 10:09:51 PM1/17/17
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"a0149848f7c068bc8507d3ec6f93cd2b7256098a" a0149848]:
{{{
#!CommitTicketReference repository=""
revision="a0149848f7c068bc8507d3ec6f93cd2b7256098a"
Refs #25665 -- Removed GEOSGeometry.get/set_srid() per deprecation
timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:12>

Django

unread,
Jan 17, 2017, 10:09:52 PM1/17/17
to django-...@googlegroups.com
#25665: deprecate public getters/setters for properties of `GEOSGeometry` and its
subclasses
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"997c9f709974ea79d9eb9e83eaf24e7bc0e7f9d4" 997c9f70]:
{{{
#!CommitTicketReference repository=""
revision="997c9f709974ea79d9eb9e83eaf24e7bc0e7f9d4"
Refs #25665 -- Removed deprecated getter/setter of Point.tuple.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25665#comment:14>

Reply all
Reply to author
Forward
0 new messages