-
Notifications
You must be signed in to change notification settings - Fork 13
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
Notifying implementation inconsistency in user properties #86
Comments
It has to be generated at least for the whole major progenitor branch, otherwise it’s not defined. But it would be nice if a neater/more helpful error resulted... |
Ok thanks for the clarification. I will leave it up to you to decide if a better error message should be added and if a better try/catch mechanism should be added to the web server to avoid it completely breaking if histogram properties fail. Otherwise, I'll just close this issue and it will serve as documentation on SFR_histogram. |
I finally got to the bottom of this. It was due to my declaration of the property name. I declared it as When performing the calculation loop, the code here tangos/tangos/tools/property_writer.py Lines 407 to 413 in 7f36946
would evaluate the need to listize to False because the property name is a list type. Once the actual calculation was done by my property, it would return an SFR array as result which would go through this snippet of code: tangos/tangos/tools/property_writer.py Lines 423 to 428 in 7f36946
No list rewrapping would be done as the if test evaluates to False. When queued for later committing, the result array would be broken down by a zip call here: tangos/tangos/tools/property_writer.py Lines 259 to 261 in 7f36946
and the database would end up storing only the first number in the array, rather than the full array. This one number would then be retrieved during the reassembly, leading the above failure. This error clearly follows my own coding error when declaring the property name, but the bug was incredibly difficult to catch as TANGOS swallowed the problem very deep without complaining. One way to avoid this in the future would be to implement additional consistency checks for example verifying that the length of the calculated result matches the length of the stored result, as well as throwing a more sensible error in the reassembly method if its arguments are not what is expected. Note that in the end, this has nothing to do with the SFR_histogram being generated for only one output. |
Ah, I see, yes it would be useful to implement a simple test to catch this type of inconsistency |
Hi,
I am getting an unexpected error following my calculation of the SFR_histogram for a single halo at the latest timestep: 'tangos write SFR_histogram SFR_10Myr --for Halo600 --latest --hmax=0'.
The error reads:
I think the problem is generated because there is only one SFR_histogram property available across the merger tree of this halo, and hence a number (which has no length) is retruned rather than an array.
Am I misusing this property (in the sense that it should always be generated across the full merger tree) or is this a bug?
The error also generates a catastrophic failure of the web server preventing from accessing the page of this halo (but not the timestep page or other halo pages). I think this is because the webserver tries by default to reassemble histogram properties which fail with the same error as above.
Thanks
Martin
The text was updated successfully, but these errors were encountered: