[cgma-dev] CGM 13.1 and PyTAPS
Anthony Scopatz
scopatz at gmail.com
Mon Dec 16 15:46:30 CST 2013
On Mon, Dec 16, 2013 at 12:46 PM, Iulian Grindeanu <iulian at mcs.anl.gov>wrote:
>
>
> ------------------------------
>
> Hi Iulian,
>
> To differentiate in the test iGeom will have to have a version number
> associated with it that is accessible from Python (probably via another
> part of PyTAPS). Then you can compare the version number and execute the
> appropriate part of the test.
>
> yes, this is something I don't know how to do. Or what is the
> standard/preferred way to do it in python.
>
Often times people just have a "__version__" str in their package's base
__init__.py. That would be the appropriate thing to do for PyTAPS. For
igeom, etc, it might be most appropriate to just have a namedtuple, whose
instance is called something like 'version_info' like is done for Python
itself in the sys module [1]
1. http://docs.python.org/2/library/sys.html#sys.version_info
>
> Arguably a better solution would be for the PyTAPS wrapper function to
> keep the same API it has now, test what version of igeom it has, and
> perform the appropriate call. This is a much better solution because then
> downstream code, tests included, won't need to change.
>
> this is a good idea, and I can do it without exporting anything else. It
> is just that the new argument (point) will always be [0,0,0],
> so we cannot test anything else. If we always pass 0, why bother with
> modifying iGeom?
>
Yup, sounds good to me. It might be nice if this was a keyword argument so
the user could modify it if they *really* wanted to, but that is not
necessary.
>
>
> For further arguments sake, it is probably not the right thing to do for
> the function signatures to change on micro version numbers. This is really
> bad for stability. I don't know what the specific use case is here,though,
> so maybe it is justified.
>
> yes, this is a good point. changing interface is never a good thing; and
> micro versions should never change function signatures.
> It should be at least version 1.5.0 then :)
>
At least :).
Be Well
Anthony
>
> Thanks,
> Iulian
>
> Be Well
> Anthony
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/cgma-dev/attachments/20131216/c7e4b9ca/attachment.html>
More information about the cgma-dev
mailing list