-
-
Notifications
You must be signed in to change notification settings - Fork 400
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: Added a conditional statement and changed the error type that was being handled in tardis.io.model_reader.read_uniform_abundances
.
#2573
Bugfix: Added a conditional statement and changed the error type that was being handled in tardis.io.model_reader.read_uniform_abundances
.
#2573
Conversation
A standalone code which can be easily integrated into the TARDIS code base, to build a plot functionality that visualizes the number of packet interactions as a function of the last interaction velocity for each element present in the ejecta.
Output of velocity_packet_tracker.py
They are added to a different repository in my Git account: https://github.com/KC210404/GSOC2024_tardis
They already exist in a different repository in my Git account: https://github.com/KC210404/GSOC2024_tardis
They already exist in a different repository in my Git account: https://github.com/KC210404/GSOC2024_tardis
They already exist in a different repository in my Git account: https://github.com/KC210404/GSOC2024_tardis
They already exist in a different repository in my Git account: https://github.com/KC210404/GSOC2024_tardis
They already exist in a different repository in my Git account: https://github.com/KC210404/GSOC2024_tardis
They already exist in a different repository in my Git account: https://github.com/KC210404/GSOC2024_tardis
*beep* *bop* Hi, human. The Click here to see your results. |
*beep* *bop* Hi, human. I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently. Please add your name and email to In case you need to map an existing alias, follow this example. |
*beep* *bop* Hi, human. I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently. Please add your name and email to In case you need to map an existing alias, follow this example. |
馃摑 Description
Type: 馃
bugfix
While working on the first objective plots for GSOC'24, I found a bug in the function: tardis.io.model_reader.reader.read_uniform_abundances (model_reader.py file).
Bug Description:
According to the schema of the abundances sub-section of the model section, after validation, the key model_isotope_time_0 gets added to the validated abundances section. However, when we pass this validated abundances section to the function read_uniform_abundances, there is no condition to handle model_isotope_time_0. Neither is it a "type" nor is it an elemental or isotopic species. Consequently, it reaches the last else statement (nested-else), where actually the isotopic species should go to, which are passed to the Nuclide of the radioactivedecay library of Python to get the multi-level index of the species in the isotope_abundance DataFrame. But since model_isotope_time_0 is not an isotopic species and is a compulsory inclusion at the validation stage, it must be handled by adding a string comparison like with the "type"-key in the abundances section. We can't loop until the last but one element (model_isotope_time_0 is the last key), because in cases where the config-dict is not validated then this key wouldn't be added, and we would lose the last species abundance.Secondly, we need to handle such strings which are not either elemental or isotopic species for which the try-except block with a runtime error getting excepted is already added. However, when such strings are passed to the Nuclide function, radioactivedecay.utils.NuclideStrError gets generated, not a runtime error. So these two changes were done to the code.
Example: validated-abundances section of tardis_example.yml file: {'type': 'uniform', 'O': 0.19, 'Mg': 0.03, 'Si': 0.52, 'S': 0.19, 'Ar': 0.04, 'Ca': 0.03, 'model_isotope_time_0': <Quantity 0. s>}
Note:
Key inclusions such as the "model_isotope_time_0" key occur at the validation stage for different sections of the YAML file configuration. So, when a specific section is parsed from the validated configuration dictionary (which is done by the functions in model_reader.py), it is important that such key inclusions be handled and debugged.馃殾 Testing
How did you test these changes?
鈽戯笍 Checklist
build_docs
label