Closed YannisArgyriou closed 2 years ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Hi @orifox,
Thank you for submitting these changes to @YannisArgyriou's notebook. Please read on for the technical review.
The technical review helps ensure that contributed notebooks a) run from top to bottom, b) follow the PEP8 standards for Python code readability, and c) conform to the Institute's style guide for Jupyter Notebooks.
I've pushed the review as a new commit in this pull request. To view and edit the commit locally, follow these steps:
git checkout THIS-BRANCH
git fetch YANNIS-REMOTE-FORK main
git merge YANNIS-REMOTE-FORK/THIS-BRANCH
_(THIS-BRANCH
is the name you gave this branch on your local machine. YANNIS-REMOTE
is the name you gave Yannis' remote on your local machine. If you don't know your name for the remote, run git remote -v
and choose the one matched with the path ending in YannisArgyriou/dat_pyinthesky.git
.)_
From here you can work on your branch as normal. If you have trouble with this step, please let me know before continuing.
After updating your local copy of this branch, please open your notebook and address any warnings or errors you find.
If you see cells with output like this, it means some of your code doesn't follow the PEP8 standards of code readability:
(In the example above, INFO - 3:3: E111
means that the text entered on line 3 at index 3 caused the warning "E111". The violation is briefly described at the end of the message.)
You can test that your edits satisfy the standard by installing flake8
on the command line with:
pip install flake8==3.7.3 pycodestyle_magic
Then, restart the notebook and run the following cells under the imports:
After that, edit and re-run cells with warnings until you've fixed all of them. Please remember to delete the cells shown in the above image before pushing your changes back to this pull request.
If you have questions or feedback on specific cells, click the earlier message in this thread from the "review-notebook-app" bot. There, you can comment on specific cells and view what's changed in the new commit. I may also write comments there. Anything posted there will also be reflected in this pull request's conversational thread.
⚠️ Notebook execution: I was not able to run the notebook from top to bottom.
photutils
at 1.1.0 and (in pre-requirements.txt
) numpy
at 1.18.5 held other packages back from using their most recent versions. I condensed requirements.txt
to a set of packages whose own requirements should cover the previous list without harming the notebook (I believe).PointSourceDetectorBasedExtractionFuncs
. This happens because the Box folder's .py
files aren't downloading correctly. See the cell-specific comment for more information, but once it's fixed, I believe the other NameError
s should resolve themselves.⚠️ Code style: There are a good number of PEP8 violations.
jwst
's usual wave of printouts.✅/⚠️ Notebook style
Hi @orifox, did you try running your edited version of this notebook from scratch? When I do, some cells (like those that run the pipeline) reference paths that don't exist after I download the data files.
I suspect you didn't clear out files from your previous runs. If this is true, try deleting all files in jdat_notebooks/MRS_Mstar_analysis
except the .ipynb
files, files ending in requirements.txt
, and the two .py
files you added. Run the notebook and see if it still works for you.
I also un-resolved a conversation thread about a missing import.
@ofox:
⚠️ Notebook execution: I was not able to run the notebook from top to bottom without adjustments.
✅ Code style: All PEP8 errors were addressed.
✅/⚠️ Notebook style
It looks like the CRDS_SERVER_URL
is being converted into 'https://crds-serverless-mode.stsci.edu/'
somewhere along the line in the following traceback, causing an error:
I was able to run the notebook to completion by setting environment variables related to CRDS before imporrting the crds
package (h/t to the JWST Help Desk). The package sets CRDS_PATH
, CRDS_SERVER_URL
, and other variables to predetermined default values if they don't already exist before the import.
In my case, trying to reassign any of these environment variables post-import did not work, but this was not the case for @orifox and some others. I don't (yet?) know the source of the inconsistency.
At any rate, this fix resolves the last action item from my technical review.
@orifox gave clearance to merge the notebook. It's unfortunate to lose the commit history, but I will squash the commits beforehand to reduce bloat in the repository.
New notebook delivered as part of analysis of M star spectrum with the MRS. The notebook extracts a point source spectrum from the 2D detector image plane instead of the 3D IFU spectral cubes. This allows to introduce several percent-level corrections, as well as extract the flux in an optimal way using the variance and PSF fraction of each individual pixel.
Including here @drlaw1558 , @orifox @astroolivine
REQUEST FOR BOX ACCESS TO UPLOAD RELATED FILES, PLEASE USE EMAIL: argyriou.yannis@gmail.com