Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.050 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'subject:Python': 0.06; 'suppose': 0.07; 'anticipate': 0.09; 'decision.': 0.09; 'subject:module': 0.09; 'subject:skip:c 10': 0.09; '(just': 0.16; 'drifting': 0.16; 'inputs': 0.16; 'sense,': 0.16; 'subject: \n ': 0.16; 'subject:etc.': 0.16; 'subject:values': 0.16; 'think.': 0.16; 'typos': 0.16; 'wrote:': 0.18; 'module': 0.19; 'seems': 0.21; 'input': 0.22; 'separate': 0.22; 'header:User-Agent:1': 0.23; 'decide': 0.24; 'references': 0.26; 'header:In-Reply-To:1': 0.27; 'record': 0.27; 'point': 0.28; 'am,': 0.29; 'change,': 0.30; 'code': 0.31; 'subject:what': 0.31; 'trouble': 0.34; 'there': 0.35; 'really': 0.36; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'remove': 0.60; 'dave': 0.60; 'conversion': 0.61; 'new': 0.61; 'digital': 0.61; 'name': 0.63; 'kind': 0.63; 'day.': 0.63; 'more': 0.64; 'worth': 0.66; 'subject:. ': 0.67; 'received:74.208': 0.68; 'records': 0.73; 'grow': 0.77; 'adc': 0.84; 'factors,': 0.84; 'presumably': 0.84; 'voltage': 0.84; 'angel': 0.91; 'troublesome': 0.91 Date: Thu, 02 Oct 2014 14:50:17 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? References: <54hqfb-nan.ln1@chris.zbmc.eu> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:FHOymXjuq0jJvHSC8gA0RFfV2QOUPlvVWMRU1+/FpqN W0GevZxcW6A2XTZ8nznLvERxgvkukVjEmNSu33iKf9/hOHj9PQ 8qjaJ1G1yIxp1+TZcHXz0OiKoO0+h30N4CCjtL7hWOp79Ugie7 0bwvwGtuSQ5Cx9yIFyIDrGprTX8KTRvL9ZT2K+SRsO4JTJovs+ GuSoTXXaYGHEch6t18dHv5Wfc6ZU8ZdDMMB1PSsBJj7kZXiHJV 578JXAkEcs6Tafz/q+RZdVzZ2WpfBAG/ZNNUXWbDwZNAWqO0Oj 7HiF38xRUWsLZPjGke6t2OqN1607gunloAqtlvFy3a8k7XrhwD /QE3PAJl1058mVDvI770= X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412275829 news.xs4all.nl 2932 [2001:888:2000:d::a6]:55608 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78621 On 09/30/2014 10:55 AM, cl@isbd.net wrote: > Dave Angel wrote: >> .... >> name. And presumably you never remove an old name from the >> config. >> > The only things really likely to change (and may change regularly) are > the conversion factors, drifting voltage references etc. will > inevitably require these to be recalibrated every so often. Other > than that it's just typos or me deciding to change the name of > something. > Right there you have an important design decision. You then presumably have to have a way that each particular data point can record what configuration it's associated with. If you just change the calibration data externally, then all the old records are invalidated. > >> More troublesome is adding a new kind of data. You have to decide >> whether it's worth generalizing the code to anticipate the >> change, or just admit that the code will grow at that point and >> that old code won't deal with the new data. >> > There's a separate module for each input type (just ADC and 1-wire at > the moment), I don't anticipate any more though I suppose there might > be digital inputs one day. So a configuration [file] for each type > seems to make sense, generalising it would be more trouble than it's > worth I think. > > -- DaveA