Issue 106: Help with Math-Accuracy Error Raised From findKey During CI Run

17 views
Skip to first unread message

Hemal Varambhia

unread,
Jul 8, 2019, 5:04:31 PM7/8/19
to polymath...@googlegroups.com
Dear Colleagues,
I am currently working on issue 106, which is to add the coveralls.io test coverage tool to the PolyMath project. At this point I am currently blocked by the Math-Tests-Accuracy and Math-Accuracy packages, which are yielding an error with the message 'run:in:with: called in wrong context.' The 'run:in:with:' comes from SmalltalkCI, our CI tool of choice. Werner, from Serge I understand that you are the author of the above-mentioned packages. Would you be willing to pair with me on this? I could use your expertise here. If so, when would be best? I would prefer Fridays if that is possible.

Thank you for your assistance in the above regard. I look forward to hearing from you in due course.

Yours sincerely,
Hemal
--
 
"Musbury",
16 Devonshire Road,
Mill Hill,
London,
NW7 1LL

Home:  +44 (0) 208 346 6444
Mobile: +44 (0) 7751 879 908

Serge Stinckwich

unread,
Jul 13, 2019, 1:17:01 PM7/13/19
to polymath...@googlegroups.com, Werner Kassens
Yes I think this is the code of Werner.
Are you there Werner to help a little bit Hemal ?
Thank you.


--
You received this message because you are subscribed to the Google Groups "PolyMath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymath-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymath-project/CABgoFPf%2BwJ-hR29Zc7FUJX8PHB7cJXG91rm-HM72oq4nVF_faw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Serge Stinckwic
​h​

Int. Research Unit
 on Modelling/Simulation of Complex Systems (UMMISCO)
​Sorbonne University
 (SU)
French National Research Institute for Sustainable Development (IRD)​
U
​niversity of Yaoundé I​, Cameroon
"Programs must be written for people to read, and only incidentally for machines to execute."
https://twitter.com/SergeStinckwich

Hemal Varambhia

unread,
Jul 14, 2019, 6:09:46 AM7/14/19
to polymath...@googlegroups.com
Dear Werner,
I am currently working on issue 106, which is to add the coveralls.io test coverage tool to the PolyMath project. At this point I am currently blocked by the Math-Tests-Accuracy and Math-Accuracy packages, which are yielding an error with the message 'run:in:with: called in wrong context.' The 'run:in:with:' comes from SmalltalkCI, our CI tool of choice. Werner, from Serge I understand that you are the author of the above-mentioned packages. Would you be willing to pair with me on this? I could use your expertise here. If so, when would be best? I would prefer Fridays if that is possible.

I have refactored findKey to make the logic clearer, but your review and advice on why an error should be raised would be helpful because I lack understanding/context here. The link to the refactoring PR is:


Thank you for your assistance in the above regard. I look forward to hearing from you in due course.

Yours sincerely,
Hemal

PS. Thank you, Serge, for appealing to Werner on my behalf.

werner kassens

unread,
Jul 14, 2019, 10:33:40 AM7/14/19
to PolyMath
Hi Hemal, Hi Serge,
i have to admit i dont check this group regularly, but since Serge sent an email to me directly, now i noticed it. i dont know what coveralls.io is, but i downloaded pharo8 and polymath and noticed an error in PMAccuracyTest>>testIfSeveralterations. if this is the problem, that can probably be repaired by changing this line in PMAccuraccy>>run: from
self ifSeveralterations: [ aStream << 'iterations: '    << iterations; cr ].
to
self ifSeveralterations: [ aStream << 'iterations: '    << iterations asString; cr ].

does that help, Hemal?
werner

Hemal Varambhia

unread,
Jul 14, 2019, 10:58:49 AM7/14/19
to polymath...@googlegroups.com
Werner,
Thank you for replying so quickly. The actual problem I'm experiencing is shown in the link below:


It comes from the error raised in findKey. Does that really need to throw an error?

Hemal

Hemal

--
You received this message because you are subscribed to the Google Groups "PolyMath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymath-proje...@googlegroups.com.

werner kassens

unread,
Jul 16, 2019, 4:42:07 AM7/16/19
to PolyMath
Hi Hemal,
<stupid grin> that link does not help me, since i dont know how to load the necessary things. but if you find the error in findkey (i have no idea why i added that, but i guess it should help me to use Accuracy correctly) too restrictive, then simply throw it away.
werner

Hemal Varambhia

unread,
Jul 16, 2019, 5:57:40 AM7/16/19
to polymath...@googlegroups.com
Dear Werner,
That was my initial thought, to have findKey not throw an error but I wanted to check with you first. No clients are relying on the package currently so this looks like it'd be safe. I will make that change and ask you and Serge to review the PR if you have capacity and energy.

In terms of local setup and reproducing the error in that link, use the instructions here. I recommend you checkout the development branch.

Yours sincerely,
Hemal

--
You received this message because you are subscribed to the Google Groups "PolyMath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymath-proje...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hemal Varambhia

unread,
Jul 16, 2019, 5:57:29 PM7/16/19
to polymath...@googlegroups.com
Werner and Serge,
As mentioned earlier in the chain the refactoring PR is now ready for your perusal:


Please review when you have energy and capacity. The key thing to mention here is that the ifNone clause in findKey now yields an empty string. This way any client using this code is guaranteed to get a string back and won't have to resort to null checks. Of course this isn't final and your advice/review on this would be very helpful.

Once this is accepted and merged, I will proceed to get the Math-Accuracy package under test coverage for us as a new PR.

Thank you, Werner, for helping to unblock me.

Yours sincerely,
Hemal

Serge Stinckwich

unread,
Jul 17, 2019, 4:02:02 AM7/17/19
to polymath...@googlegroups.com
I merge the PR.
Thank you to both of you.



For more options, visit https://groups.google.com/d/optout.


--

werner kassens

unread,
Jul 17, 2019, 6:26:43 AM7/17/19
to PolyMath
Hi Hemal,
it is my impression that the second example in the docu with

initializeSine
self argument: (0 to: Float pi by: Float pi /2).
self result: #((0)(1)(0))

and

checkSine
^self argument sin

doesnt work anymore but this has nothing to do with your changes. i had constructed the Accuracy package a bit complicated, and i'd guess it should simply be thrown away.
werner

On Tuesday, July 16, 2019 at 11:57:29 PM UTC+2, Hemal Varambhia wrote:
Werner and Serge,
As mentioned earlier in the chain the refactoring PR is now ready for your perusal:


Please review when you have energy and capacity. The key thing to mention here is that the ifNone clause in findKey now yields an empty string. This way any client using this code is guaranteed to get a string back and won't have to resort to null checks. Of course this isn't final and your advice/review on this would be very helpful.

Once this is accepted and merged, I will proceed to get the Math-Accuracy package under test coverage for us as a new PR.

Thank you, Werner, for helping to unblock me.

Yours sincerely,
Hemal

On Tue, 16 Jul 2019 at 10:57, Hemal Varambhia <h.n.v...@gmail.com> wrote:
Dear Werner,
That was my initial thought, to have findKey not throw an error but I wanted to check with you first. No clients are relying on the package currently so this looks like it'd be safe. I will make that change and ask you and Serge to review the PR if you have capacity and energy.

In terms of local setup and reproducing the error in that link, use the instructions here. I recommend you checkout the development branch.

Yours sincerely,
Hemal

On Tue, 16 Jul 2019 at 09:42, werner kassens <werne...@gmail.com> wrote:
Hi Hemal,
<stupid grin> that link does not help me, since i dont know how to load the necessary things. but if you find the error in findkey (i have no idea why i added that, but i guess it should help me to use Accuracy correctly) too restrictive, then simply throw it away.
werner

On Sunday, July 14, 2019 at 4:58:49 PM UTC+2, Hemal Varambhia wrote:
Werner,
Thank you for replying so quickly. The actual problem I'm experiencing is shown in the link below:


It comes from the error raised in findKey. Does that really need to throw an error?

Hemal

--
You received this message because you are subscribed to the Google Groups "PolyMath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymath...@googlegroups.com.


--
 
"Musbury",
16 Devonshire Road,
Mill Hill,
London,
NW7 1LL

Home:  +44 (0) 208 346 6444
Mobile: +44 (0) 7751 879 908

Hemal Varambhia

unread,
Jul 17, 2019, 7:09:52 AM7/17/19
to polymath...@googlegroups.com
Werner,
You mean delete the Math-Accuracy package entirely from PolyMath?

Hemal

To unsubscribe from this group and stop receiving emails from it, send an email to polymath-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymath-project/7d275e3a-99f3-4ff6-9ac9-332cd5249fc7%40googlegroups.com.

werner kassens

unread,
Jul 17, 2019, 7:56:05 AM7/17/19
to PolyMath
Hi Hemal,
yes. btw if my recollection is correct you made a few other earlier changes i hadnt looked at, it is possible that one of them lead to that result.
werner

On Wednesday, July 17, 2019 at 1:09:52 PM UTC+2, Hemal Varambhia wrote:
Werner,

Hemal Varambhia

unread,
Jul 17, 2019, 8:03:36 AM7/17/19
to polymath...@googlegroups.com
Werner,
Could you send me the failing code and steps to reproduce the problem?

Hemal


--
You received this message because you are subscribed to the Google Groups "PolyMath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymath-proje...@googlegroups.com.

werner kassens

unread,
Jul 17, 2019, 8:22:06 AM7/17/19
to PolyMath
Hi Hemal
i attached AccuracySin.st.
you file it in and then do:

a:=AccuracySin new.
a run.

which produces an error
werner

On Wednesday, July 17, 2019 at 2:03:36 PM UTC+2, Hemal Varambhia wrote:
Werner,
Could you send me the failing code and steps to reproduce the problem?

Hemal


On Wed, 17 Jul 2019, 12:56 werner kassens, <werne...@gmail.com> wrote:
Hi Hemal,
yes. btw if my recollection is correct you made a few other earlier changes i hadnt looked at, it is possible that one of them lead to that result.
werner

On Wednesday, July 17, 2019 at 1:09:52 PM UTC+2, Hemal Varambhia wrote:
Werner,
You mean delete the Math-Accuracy package entirely from PolyMath?

Hemal


--
You received this message because you are subscribed to the Google Groups "PolyMath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymath...@googlegroups.com.
AccuracySin.st

Hemal Varambhia

unread,
Jul 17, 2019, 11:39:49 AM7/17/19
to polymath...@googlegroups.com
Werner,
Could you send me a screenshot of the error, please? I do get an error as well - it says that floating point numbers are not indexable (see screenshot below). Is this what you get?

accuracy_error.png

Yours sincerely,
Hemal

To unsubscribe from this group and stop receiving emails from it, send an email to polymath-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymath-project/9b61f432-c0b6-4677-970f-0d24456e00d1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

werner kassens

unread,
Jul 17, 2019, 12:27:22 PM7/17/19
to PolyMath
yes exactly
werner

Hemal Varambhia

unread,
Jul 17, 2019, 1:14:29 PM7/17/19
to polymath...@googlegroups.com
Werner,
I had a look through the stacktrace and it doesn't contain any of the methods that I changed so I am likely missing something. Was the instance created correctly from what you can see in the debugger? Perhaps we could pair on this to get to the root cause. Do you have some time this Friday?

Hemal

To unsubscribe from this group and stop receiving emails from it, send an email to polymath-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymath-project/ba4456d4-3e1f-4e0c-a87a-8337a01bdc75%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

werner kassens

unread,
Jul 17, 2019, 2:50:12 PM7/17/19
to PolyMath
Hi Hemal,
i looked at all our changes & they are not responsible for that error. this is obviously the result of some changes in pharo and those things will repeat with future changes; eg in pharo 8 the change that i mentioned in an earlier message will be necessary & the necessity won't be visible with the tests as they are not complete enough (im not sure but perhaps it will be visible when one makes a test that runs AccuracySine, didnt try that). the general problem with this package is that it is in principle just a simple database program that does not use any of the standard databases, but does everything by itself & additionally uses occasionally some lowlevel functions & with your changes is not really covered by tests, iow i would _seriously_ just throw it away. originally i made it only because i needed it for making the genetic algo & therefore it was fine, but it was for me just a little subprogram quickly cobbled together, because i needed it, nothing worth keeping.
werner

p.s. i dont want to pair program, i never did this, dont have the necessary programs for it (no messenger program at all), havent used pharo for a year ( iow i am much too slow for this <friendly grin>)

On Wednesday, July 17, 2019 at 7:14:29 PM UTC+2, Hemal Varambhia wrote:
Werner,
Reply all
Reply to author
Forward
0 new messages