Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #22178 > unrolled thread
| Started by | André Roberge <andre.roberge@gmail.com> |
|---|---|
| First post | 2012-03-26 04:47 -0700 |
| Last post | 2012-03-26 05:21 -0700 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.lang.python
Puzzled by FiPy's use of "==" André Roberge <andre.roberge@gmail.com> - 2012-03-26 04:47 -0700
Re: Puzzled by FiPy's use of "==" Robert Kern <robert.kern@gmail.com> - 2012-03-26 13:16 +0100
Re: Puzzled by FiPy's use of "==" André Roberge <andre.roberge@gmail.com> - 2012-03-26 05:21 -0700
Re: Puzzled by FiPy's use of "==" André Roberge <andre.roberge@gmail.com> - 2012-03-26 05:21 -0700
| From | André Roberge <andre.roberge@gmail.com> |
|---|---|
| Date | 2012-03-26 04:47 -0700 |
| Subject | Puzzled by FiPy's use of "==" |
| Message-ID | <24963904.2261.1332762433787.JavaMail.geo-discussion-forums@vbbfw10> |
In FiPy (a finite volume PDE solver), equations are "magically" set up as eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D) and solved via eqX.solve(...) How can eqX be anything than True or False?... This must be via a redefinition of "==" but I can't see how that is done. I did look at many of the source files, thinking that it must be via a redefinition of "__eq__" somewhere but with no luck. Any pointers would be appreciated.
[toc] | [next] | [standalone]
| From | Robert Kern <robert.kern@gmail.com> |
|---|---|
| Date | 2012-03-26 13:16 +0100 |
| Message-ID | <mailman.996.1332764185.3037.python-list@python.org> |
| In reply to | #22178 |
On 3/26/12 12:47 PM, André Roberge wrote: > In FiPy (a finite volume PDE solver), equations are "magically" set up as > > eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D) > > and solved via > > eqX.solve(...) > > How can eqX be anything than True or False?... This must be via a redefinition of "==" but I can't see how that is done. I did look at many of the source files, thinking that it must be via a redefinition of "__eq__" somewhere but with no luck. Any pointers would be appreciated. It's in the root base class Term: http://matforge.org/fipy/browser/trunk/fipy/terms/term.py#L374 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
[toc] | [prev] | [next] | [standalone]
| From | André Roberge <andre.roberge@gmail.com> |
|---|---|
| Date | 2012-03-26 05:21 -0700 |
| Message-ID | <mailman.997.1332764527.3037.python-list@python.org> |
| In reply to | #22182 |
On Monday, 26 March 2012 09:16:07 UTC-3, Robert Kern wrote: > On 3/26/12 12:47 PM, André Roberge wrote: > > In FiPy (a finite volume PDE solver), equations are "magically" set up as > > > > eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D) > > > > and solved via > > > > eqX.solve(...) > > > > How can eqX be anything than True or False?... This must be via a redefinition of "==" but I can't see how that is done. I did look at many of the source files, thinking that it must be via a redefinition of "__eq__" somewhere but with no luck. Any pointers would be appreciated. > > It's in the root base class Term: > > http://matforge.org/fipy/browser/trunk/fipy/terms/term.py#L374 > I thought I looked at terms.py ... but I must have missed that. Thanks! > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret it as though it had > an underlying truth." > -- Umberto Eco
[toc] | [prev] | [next] | [standalone]
| From | André Roberge <andre.roberge@gmail.com> |
|---|---|
| Date | 2012-03-26 05:21 -0700 |
| Message-ID | <22079866.1390.1332764518212.JavaMail.geo-discussion-forums@vbmf37> |
| In reply to | #22182 |
On Monday, 26 March 2012 09:16:07 UTC-3, Robert Kern wrote: > On 3/26/12 12:47 PM, André Roberge wrote: > > In FiPy (a finite volume PDE solver), equations are "magically" set up as > > > > eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D) > > > > and solved via > > > > eqX.solve(...) > > > > How can eqX be anything than True or False?... This must be via a redefinition of "==" but I can't see how that is done. I did look at many of the source files, thinking that it must be via a redefinition of "__eq__" somewhere but with no luck. Any pointers would be appreciated. > > It's in the root base class Term: > > http://matforge.org/fipy/browser/trunk/fipy/terms/term.py#L374 > I thought I looked at terms.py ... but I must have missed that. Thanks! > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret it as though it had > an underlying truth." > -- Umberto Eco
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web