-
Notifications
You must be signed in to change notification settings - Fork 3
Add Psi Correspondence Theorem #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@jvdp1 At the moment |
tests/mod_testing.fypp
Outdated
|
|
||
| #! Macro to register golden value | ||
| #:def save_gold( lbl, val ) | ||
| $:tstlbl[ntst] = lbl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically, this line trips fypp, at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand your code, you would like to store some stuff inside fypp to check against it after running a function. fypp is a preprocessor and is used to generate code, not as test unit framework. You could use fypp as described in its doc (see assert here. However, I think that, you should use e.g., test-drive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand it correctly, the assert statement will immediately halt execution on a failure, which I don't think is desirable for testing. I read somewhere in the fypp docs that certain commands are executed on a Python sandbox, hence why I thought it is possible to access (write and read) Python dictionaries. The "golden" data to compare to and the check macros get hardcoded into the testing subroutine at preprocessing time.
On the other hand, test-drive looks interesting. Do you know if it supports checking arrays too (which might be needed for other operations, but not for Gamma)?
|
`test-drive` does not support arrays yet. However, intrinsics like `any()`
or `all()` can be used (e.g., `call check( all(array1 == array2))`)
Le mer. 27 oct. 2021 à 21:38, Wileam Y. Phan ***@***.***> a
écrit :
… ***@***.**** commented on this pull request.
------------------------------
In tests/mod_testing.fypp
<#9 (comment)>:
> + #:global ntst
+ #:set ntst = 0
+ #:global nerr
+ #:set nerr = 0
+
+ #! Dictionaries to hold golden values and test labels
+ #:global chkval
+ #:set chkval = {}
+ #:global tstlbl
+ #:set tstlbl = {}
+
+#:enddef
+
+#! Macro to register golden value
+#:def save_gold( lbl, val )
+ $:tstlbl[ntst] = lbl
If I understand it correctly, the assert statement will immediately halt
execution on a failure, which I don't think is desirable for testing. I
read somewhere in the fypp docs that certain commands are executed on a
Python sandbox, hence why I thought it is possible to access (write and
read) Python dictionaries. The "golden" data to compare to and the check
macros get hardcoded into the testing subroutine at preprocessing time.
On the other hand, test-drive looks interesting. Do you know if it
supports checking arrays too (which might be needed for other operations,
but not for Gamma)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD5RO7DIIFPV2XCUOKUYZZ3UJBIKJANCNFSM5GYTHH5Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
|
Looks good to me. If the error code does not necessarily contain the offending dimension, you might move the check on the bounds out of the loop: |
|
My ftnunit package does allow checking arrays, but that would mean quite a change, I'd say ;) |
Interesting. Would you mind posting a repo link? |
|
Sure: https://sourceforge.net/p/flibs/svncode/HEAD/tree/trunk/src/ - you
need the code in the funit directory (I renamed it at some point)
Op di 2 nov. 2021 om 22:02 schreef Wileam Y. Phan ***@***.***
…:
My ftnunit package does allow checking arrays
Interesting. Would you mind posting a repo link?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#9 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YRYN2RINQSCEXILNNWTUKBNV3ANCNFSM5GYTHH5Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
No description provided.