Skip to content
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

SWAP expression reverts to default built in even though a task has redefined it as custom #776

Closed
NicoleRayner opened this issue Jun 20, 2024 · 4 comments
Assignees
Labels

Comments

@NicoleRayner
Copy link
Contributor

Here's the situation:
I made a copy of the built-in SWAPCustomCorrection204 expression, redefined the value model as needed and saved in my Custom Expression folder. Everything is working as it should. I then saved/exported the task as an xml for future use. The next time I attempted to use that task (with my custom 204 Correction) it wasn't there, it was back as the default one in built in. It turns out that this new custom expression doesn't actually get written to the xml of my task for some reason, even though it is working in the squid file.
Is there a limit to the number of custom expressions that can be written to an xml task? I haven't done thorough troubleshooting on this but have a vague recollection of the USGS folks saying that old squid had a limit to custom expressions and that squid3 might as well? @sbodorkos does this ring any bells?

@bowring bowring self-assigned this Jun 20, 2024
@bowring bowring added the bug label Jun 20, 2024
@bowring
Copy link
Member

bowring commented Jun 20, 2024

@NicoleRayner - no limits - this is just a plain old bug.

@NicoleRayner
Copy link
Contributor Author

Thanks for looking into this Jim. If you have a moment to explain the bug it might be helpful to record here for posterity/undertanding of future issues. Is it because it has a name recognized as "Built in" that it won't write? No rush.

@NicoleRayner
Copy link
Contributor Author

The bug is that the SWAP expression reverts back to the default Built-in one when you toggle between a Pb-U and a Pb-Th calibration on the calibration constant WM. That is why it wasn't writing to the xml, because by the time I told it to write, it was gone.....

@bowring
Copy link
Member

bowring commented Jun 21, 2024

The bug was caused by an overly-complicated work flow. The solution in v2.0.9 is to always keep SWAPCustomCorrection204 in Custom Expressions as it is not a true BuiltIn Expression. This expression is only used in the Common Pb Count Corrections tab. Now you can simply edit it or even remove it. No renaming necessary. Saving and loading tasks now works as well. There is an explanation available in the "Show Notes" for SWAPCustomCorrection204, shown below.

Edit this expression to calculate a custom corrected value for 204/206 as per Squid2.5 'column swapping' and invoke it from the Common Pb menu window for overcounts of 204.  

REQUIRED: Use the expression name 'SWAPCustomCorrection204' and define a ValueModel.  
The default definition is: 'ValueModel(Orig(["204/206"]),Orig([±"204/206"]),true)'. 

 NOTE:  Use the 'Orig' function to retrieve the unmutable value of a ratio.  Otherwise, a circular logic obtains.

Another related bug discovered and fixed in this release is that the SWAPCustomCorrection204 is re-applied to reflect any edits when opening Count Corrections tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants