Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100485

Re: Help on code comprehension from an example project of pymc

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Terry Reedy <tjreedy@udel.edu>
Newsgroups comp.lang.python
Subject Re: Help on code comprehension from an example project of pymc
Date Tue, 15 Dec 2015 17:45:01 -0500
Lines 37
Message-ID <mailman.44.1450219519.22044.python-list@python.org> (permalink)
References <5e772de2-e50f-48f1-988c-a7c3eff33b10@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de XWVaoJHP+ECfpN3ANZlligi9hE3XYrPlnDovoS0dI4Ow==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'line:': 0.07; 'subject:code': 0.07; 'subject:skip:c 10': 0.07; 'ugly': 0.07; 'expected.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Help': 0.10; 'jan': 0.11; 'value.': 0.15; "'data'": 0.16; '11:15': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'wrote:': 0.16; 'subject:project': 0.18; 'programmer': 0.18; 'runs': 0.18; 'am,': 0.23; 'code,': 0.23; 'url:edu': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'function': 0.28; 'follows': 0.29; 'referenced': 0.29; 'style.': 0.29; 'code': 0.30; 'useful': 0.33; 'robert': 0.35; 'comment': 0.35; 'project': 0.36; 'needed': 0.36; 'received:71': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'mean': 0.38; 'hi,': 0.38; 'data': 0.39; 'does': 0.39; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'called': 0.40; 'different': 0.63; 'strictly': 0.64; 'as:': 0.79; 'original.': 0.84; 'received:fios.verizon.net': 0.91
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host pool-71-185-227-36.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0
In-Reply-To <5e772de2-e50f-48f1-988c-a7c3eff33b10@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:100485

Show key headers only | View raw


On 12/15/2015 11:15 AM, Robert wrote:
> Hi,
>
> I find the useful small code project for me:
> #https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html
>
> It runs as expected.
>
> When I review the code, I find 'data' in the original line:
>
> data = pymc.Normal('data', mu=model, tau=tau, value=z_obs, observed=True)
>
> has not been referenced thereafter.

If the function is called strictly for its side-effect, then it would be 
normal to not keep the 'return' value.  Code checkers will catch this 
and warn.  Just because code is make available, does not mean it follows 
the best style.  Perhaps the programmer though 'data' might be needed 
before writing the rest.

> If I comment out the line as:
>
> #data = pymc.Normal('data', mu=model, tau=tau, value=z_obs, observed=True)
>
> the result is ugly different from the original.
>
> If I change it to:
>
> pymc.Normal('data', mu=model, tau=tau, value=z_obs, observed=True)
>
> it still runs as the original.



-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Help on code comprehension from an example project of pymc Robert <rxjwg98@gmail.com> - 2015-12-15 08:15 -0800
  Re: Help on code comprehension from an example project of pymc Chris Angelico <rosuav@gmail.com> - 2015-12-16 09:34 +1100
  Re: Help on code comprehension from an example project of pymc Terry Reedy <tjreedy@udel.edu> - 2015-12-15 17:45 -0500

csiph-web