lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Historical product files


From: Vaclav Slavik
Subject: Re: [lmi] Historical product files
Date: Thu, 20 May 2010 19:35:19 +0200

Hi,

On Wed, 2010-05-19 at 16:55 +0000, Greg Chicares wrote:
> Of course, we could use xml comments to suppress everything that isn't
> current, but then we'd have to alter the format later to make such data
> accessible again.
> 
> Is there any radically-different good idea that I've overlooked?

None that I could think of.

> Once we've chosen a format, another question arises: how can we access
> only the most-current data for now? Eventually, we'd like to choose among
> historical versions based on GUI inputs that don't yet exist; but, for now,
> I'd rather just find a clean way to get only the most recent one. Is there
> some reliable shortcut? For example, I imagine we could order top-level
> elements chronologically by "EffectiveDate" attribute (perhaps 'xmllint'
> would even do that for us), and then just read them into a C++ map:
>   data["MaxGenAcctRate"] = 0.085; // EffectiveDate="20020101"
>   ...then 0.085 gets overwritten...
>   data["MaxGenAcctRate"] = 0.070; // EffectiveDate="20050101"
>   ...then 0.070 gets overwritten...
>   data["MaxGenAcctRate"] = 0.060; // EffectiveDate="20100501"
> or is that too repugnant?

It wouldn't be terribly efficient (in the version where <item> is tagged
with the date, it would involve [fully] parsing more <item> records
needlessly). I'd rather just go through the dictionary, keep track of
which nodes have the latest effective date (for each key) and then load
data only from these nodes.

Regards,
Vaclav




reply via email to

[Prev in Thread] Current Thread [Next in Thread]