[Babase] sexskins upload errors_no mdates
Karl O. Pinc
kop at meme.com
Mon May 12 13:47:26 EDT 2008
On 05/12/2008 10:51:06 AM, kfenn wrote:
>
>
> Karl O. Pinc wrote:
>>
>> As we figured out on the phone together the Mdates are not there
>> because these are the resumption cycles after pregnancy.
>>
>> I found 2 bugs in the system related to sexskins.
>>
>> First, as we found during our phone call, the test for whether
>> the cycle associated with the sexskin has an Mdate was not
>> properly checking whether the cycle was one of resumption
>> after pregnancy. (It was testing sexskins.cid = pregs.resume,
>> which does not work because pregs.resume does not have a
>> cycles.cid value.) (Fix in db/triggers/sexskins.m4)
>>
> OK. I'm with you so far. PREGS.resume = MTD_CYCLES.tcpid =
> CYCPOINTS.cpid. There is no CYCLES.cid corresponding to
> PREGS.resume. When you say "Fix in db/..." does that mean the fix is
> already in there or you are commanding yourself to fix it?
Yes, the fix is already in.
(Another
> paragraph below says it is fixed. So is the fix in the section of
> code just before the line that reads "Raise exception.....No Mdate
> found" (about halfway through sexskins.m4)? I'm having trouble
> knowing where to look.
Yup, that's the spot.
>
>> Second, I took another look at the automatic assignment of sexskins
>> to
>> cycles with pregnancies in mind and found that the code was not
>> testing for pregnancy. It was assigning the sexskin to the cycle of
>> the CYCPOINTS row on or before the SEXSKINS.Date value, and failing
>> over to the CYCPOINTS row after SEXSKINS.Date when such a row did not
>> exist.
> So this was just ...."Hey, I wonder if we even though to check for
> pregnancies when doing the sexskin assignments"...correct?
Yes. "Hey, we've got an error in this part of the logic. I wonder
whether the same logic error shows up elsewhere." sort of thing.
And you
> found that the code hadn't been written yet? Or you found that the
> code was written, but wrong?
Er.... yes? It's hard to tell. What was written was not right.
I'm not clear because I think I am
> missing some language in your paragraph above. I don't understand
> the phrase "...failing over to the CYCPOINTS row after
> SEXSKINS.date..." Failing to carry something over?
Failover in the engineering sense. A fallback position. If there's
no cycle on or before the SEXSKINS.Date value then use the one
following the date value. If it can't do the first option then
it chooses the second. The trouble is that the first option
is not always right, because there's no test for pregnancy there.
Hummm.... The documentation (Sexual Cycle Determination section)
says:
--------<snip>--------
Relate the measurement to the cycle of the Mdate, Tdate, or Ddate that
falls on the date of the measurement or is the latest Mdate, Tdate, or
Ddate preceding the measurement, so long as there is no gap in
observation between the measurement date and Mdate, Tdate, or Ddate. If
there is no such Mdate, Tdate, or Ddate due to gaps in observation or
simple lack of data, then relate the measurement to the cycle of the
earliest Tdate or Ddate that follows the measurement but is not
separated from the measurement by a gap in observation or an
intervening Mdate. If there is no such Tdate or Ddate then the
measurement may not be recorded in Babase.
--------<snip>--------
This is not right because it does not account for pregnancies.
By the time you read this it should be changed to something better.
Please check the docs and see what you think.
So, the answer to the above is that our design was bad.
>
>> This means that when there's no Mdate after a pregnancy the
>> preceeding CYCPOINTS row will be the Zdate, and any sexskins
>> belonging
>> to the resume cycle but before the Tdate of the resume cycle are
>> erroneously assigned to the conception cycle not the resume cycle.
>> (fix in db/include/globalmacros.m4)
>>
> So we potentially had two sets of sexskin sizes for the same dates?
> Maybe clarification on the above will help me understand this
> statement better.
No. The sexkin measurement was automatically assigned to the wrong
cycle.
>
>> I fixed these problems and installed the code. Please test.
>> Run the tests in babase_test first. I've tested, but no
>> point in mucking up the real data if there's still a problem
>> somewhere. Thanks.
>>
> Will do as soon as I'm sure I understand the rest of your email. I
> always work in babase_test until I know what I'm doing.
>
>> This leaves 2 potential problems with the sexskin data in the
>> database.
>>
>> Please double check my analysis here, at least as far as you can.
>> (If you like, read the code and check my fix there too.)
>>
>> 1)
>>
>> Sexskins occurring after a conception but before the Tdate are
>> assigned the
>> wrong cycle. (The prior cycle, the conception cycle.)
>>
> I'm confused here. You mean sexskins that might occur between the
> mdate and tdate are assigned to the prior cycle ( the conceptive
> cycle)? However they should instead be all glommed together as part
> of an mtd cycle?
> I'm going to have to stop here for now because intepreting the rest
> of the email sort of depends on your response to these questions.
See above.
Karl <kop at meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
More information about the Babase
mailing list