From 1bfe31d9deef21d02142726f0bdfaed0132cacd7 Mon Sep 17 00:00:00 2001 From: snowman2 Date: Tue, 2 Jul 2019 08:23:21 -0500 Subject: [PATCH] made public properties on C classes readonly --- pyproj/_crs.pxd | 96 ++++++++++++++++++++++++------------------------ pyproj/_geod.pxd | 12 +++--- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/pyproj/_crs.pxd b/pyproj/_crs.pxd index 62aeef099..b3ad01ba5 100644 --- a/pyproj/_crs.pxd +++ b/pyproj/_crs.pxd @@ -1,23 +1,23 @@ include "proj.pxi" cdef class Axis: - cdef public object name - cdef public object abbrev - cdef public object direction - cdef public double unit_conversion_factor - cdef public object unit_name - cdef public object unit_auth_code - cdef public object unit_code + cdef readonly object name + cdef readonly object abbrev + cdef readonly object direction + cdef readonly double unit_conversion_factor + cdef readonly object unit_name + cdef readonly object unit_auth_code + cdef readonly object unit_code @staticmethod cdef create(PJ_CONTEXT* projcontext, PJ* projobj, int index) cdef class AreaOfUse: - cdef public double west - cdef public double south - cdef public double east - cdef public double north - cdef public object name + cdef readonly double west + cdef readonly double south + cdef readonly double east + cdef readonly double north + cdef readonly object name @staticmethod cdef create(PJ_CONTEXT* projcontext, PJ* projobj) @@ -26,81 +26,81 @@ cdef class AreaOfUse: cdef class Base: cdef PJ *projobj cdef PJ_CONTEXT *projctx - cdef public object name + cdef readonly object name cdef class Ellipsoid(Base): cdef double _semi_major_metre cdef double _semi_minor_metre - cdef public object is_semi_minor_computed + cdef readonly object is_semi_minor_computed cdef double _inv_flattening - cdef public object ellipsoid_loaded + cdef readonly object ellipsoid_loaded @staticmethod cdef create(PJ* ellipsoid_pj) cdef class PrimeMeridian(Base): - cdef public double longitude - cdef public double unit_conversion_factor - cdef public object unit_name + cdef readonly double longitude + cdef readonly double unit_conversion_factor + cdef readonly object unit_name @staticmethod cdef create(PJ* prime_meridian_pj) cdef class Datum(Base): - cdef public object _ellipsoid - cdef public object _prime_meridian + cdef readonly object _ellipsoid + cdef readonly object _prime_meridian @staticmethod cdef create(PJ* datum_pj) cdef class CoordinateSystem(Base): - cdef public object _axis_list + cdef readonly object _axis_list @staticmethod cdef create(PJ* coordinate_system_pj) cdef class Param: - cdef public object name - cdef public object auth_name - cdef public object code - cdef public object value - cdef public double unit_conversion_factor - cdef public object unit_name - cdef public object unit_auth_name - cdef public object unit_code - cdef public object unit_category + cdef readonly object name + cdef readonly object auth_name + cdef readonly object code + cdef readonly object value + cdef readonly double unit_conversion_factor + cdef readonly object unit_name + cdef readonly object unit_auth_name + cdef readonly object unit_code + cdef readonly object unit_category @staticmethod cdef create(PJ_CONTEXT* projcontext, PJ* projobj, int param_idx) cdef class Grid: - cdef public object short_name - cdef public object full_name - cdef public object package_name - cdef public object url - cdef public object direct_download - cdef public object open_license - cdef public object available + cdef readonly object short_name + cdef readonly object full_name + cdef readonly object package_name + cdef readonly object url + cdef readonly object direct_download + cdef readonly object open_license + cdef readonly object available @staticmethod cdef create(PJ_CONTEXT* projcontext, PJ* projobj, int grid_idx) cdef class CoordinateOperation(Base): - cdef public object _params - cdef public object _grids - cdef public object method_name - cdef public object method_auth_name - cdef public object method_code - cdef public double accuracy - cdef public object is_instantiable - cdef public object has_ballpark_transformation - cdef public object _towgs84 + cdef readonly object _params + cdef readonly object _grids + cdef readonly object method_name + cdef readonly object method_auth_name + cdef readonly object method_code + cdef readonly double accuracy + cdef readonly object is_instantiable + cdef readonly object has_ballpark_transformation + cdef readonly object _towgs84 @staticmethod cdef create(PJ* coordinate_operation_pj) @@ -110,8 +110,8 @@ cdef class _CRS(Base): cdef PJ_TYPE _type cdef PJ_PROJ_INFO projpj_info cdef char *pjinitstring - cdef public object srs - cdef public object type_name + cdef readonly object srs + cdef readonly object type_name cdef object _ellipsoid cdef object _area_of_use cdef object _prime_meridian diff --git a/pyproj/_geod.pxd b/pyproj/_geod.pxd index 4b2eafaa6..39ea56ed3 100644 --- a/pyproj/_geod.pxd +++ b/pyproj/_geod.pxd @@ -23,9 +23,9 @@ cdef extern from "geodesic.h": cdef class Geod: cdef geod_geodesic _geod_geodesic - cdef public object initstring - cdef public object a - cdef public object b - cdef public object f - cdef public object es - cdef public object sphere + cdef readonly object initstring + cdef readonly object a + cdef readonly object b + cdef readonly object f + cdef readonly object es + cdef readonly object sphere