-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add new exception report notebook for COS #305
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
""" | ||
This section is for testing and validating our S/N Calculations. | ||
""" | ||
if __name__ == "__main__": |
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.
I was reviewing the script and noticed the if __name__ == "__main__":
block used for testing. I just wanted to flag that this might not be immediately clear to many users, especially those working primarily in notebooks. Typically, notebook users won't be running scripts directly from the command line, and this main block might not be the best fit for those workflows.
- If you want users to be able to run this test from their notebooks, it might be helpful to provide some instructions on how to do so. Notebook users may not know how to interact with the main block, and it could create confusion. OR
- You could move the logic in the main block into a dedicated function. This way, users can call the function directly from their notebook or another script without needing to figure out how to trigger the main() block. It will also allow you to run tests with a simple function call rather than hardcoding things.
- also noticed that the file path in the main() block is hardcoded, but it seems like the file doesn’t exist. It might be better to either check for the file’s existence or make the path dynamic (e.g., allow the user to input the file path).
In short :)
If testing isn’t needed in the notebook workflow, consider removing theif __name__ == "__main__":
block entirely.
If you want users to be able to test from the notebook, encapsulate the logic into a separate function with clear instructions.
Let me know what you think, and feel free to reach out if you'd like to discuss this further. Thanks again for all your hard work on this!
@@ -0,0 +1,1448 @@ | |||
{ |
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.
There is some code duplication in plotting the same data tice for flux. vs wavelength. You can wrap the plotting logic into a loop to reduce redundancy.
for i, axis in enumerate(ax[0]): # Plotting flux vs wavelength on top row axis.plot(wl, flux, lw=2, color="black") axis.set_xlabel(r'Wavelength [$\AA$]') axis.set_ylabel(r'Flux [$erg\ s^{-1}\ cm^{-2}\ \AA^{-1}$]') if i == 0: axis.set_title("Flux vs Wavelength") else: axis.set_title("Flux vs Wavelength, ZOOMED") axis.set_ylim(0, 0.6e-13)
Reply via ReviewNB
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.
@srosagomez, this feedback is from an engineering perspective. However, if you prefer to keep your tutorial as is for clarity, that's fine with me. A clear workflow is more important than avoiding code duplication in the tutorial. Please check the readability and let me know :)
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.
I noticed that you have already implemented the code in the above cell. Could you please do the same for this code cell?
Hi @srosagomez, Great job, and thanks for your work on this! |
This is a new notebook. Could you also please update the toc.yml so that it renders on the HTML pages? |
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.
Thanks for your work! All looks good to me!
This notebook checklist has been made available to us by the Notebooks For All team.
Its purpose is to serve as a guide for both the notebook author and the technical reviewer highlighting critical aspects to consider when striving to develop an accessible and effective notebook.
The First Cell
<h1>
or# in markdown
).1., 2.,
etc. in Markdown).The Rest of the Cells
#
in Markdown) used in the notebook.Text
Code
Images
All images (jpg, png, svgs) have an image description. This could be
alt
property)alt
attribute with no value)Any text present in images exists in a text form outside of the image (this can be alt text, captions, or surrounding text.)
Visualizations
All visualizations have an image description. Review the previous section, Images, for more information on how to add it.
Visualization descriptions include
All visualizations and their parts have enough color contrast (color contrast checker) to be legible. Remember that transparent colors have lower contrast than their opaque versions.
All visualizations convey information with more visual cues than color coding. Use text labels, patterns, or icons alongside color to achieve this.
All visualizations have an additional way for notebook readers to access the information. Linking to the original data, including a table of the data in the same notebook, or sonifying the plot are all options.