usnistgov / fipy

FiPy is a Finite Volume PDE solver written in Python
http://pages.nist.gov/fipy/en/latest
Other
505 stars 148 forks source link

Convert integer to string in operator variable represenation #1013

Closed guyer closed 7 months ago

guyer commented 7 months ago

Fixes #961 Addresses #1011

tkphd commented 7 months ago

I'm not pythonic enough to understand what this syntax change means. It looks like you're changing the code from taking the second element of the array, to I have no idea what the [...]-th element means.

guyer commented 7 months ago

I'm not pythonic enough to understand what this syntax change means. It looks like you're changing the code from taking the second element of the array, to I have no idea what the [...]-th element means.

The test is asking for the represenation of the lazy evaluation of the second element in the array. Under Python 2.7, it returned Variable(value=array([1, 2, 3, 4]))[index]. (After this fix) under Python 3, it returns Variable(value=array([1, 2, 3, 4]))[1]. # doctest: +ELLIPSIS enables me to write a test that accepts either output.

The fact that humans won't know what that means is OK; this test is under _testBinOp() because it's not intended as documentation.

tkphd commented 7 months ago

I'm not pythonic enough to understand what this syntax change means. It looks like you're changing the code from taking the second element of the array, to I have no idea what the [...]-th element means.

The test is asking for the represenation of the lazy evaluation of the second element in the array. Under Python 2.7, it returned Variable(value=array([1, 2, 3, 4]))[index]. (After this fix) under Python 3, it returns Variable(value=array([1, 2, 3, 4]))[1]. # doctest: +ELLIPSIS enables me to write a test that accepts either output.

The fact that humans won't know what that means is OK; this test is under _testBinOp() because it's not intended as documentation.

Ah-ha! Cool, thank you.

guyer commented 7 months ago

nix is the devil

tkphd commented 7 months ago

nix is the devil

and not spoken of in polite company