lsst-epo / citizen-science-notebooks

A collection Jupyter notebooks that can be used to associate Rubin Science Platform data to a Zooniverse citizen science project.
3 stars 1 forks source link

Flake8 error in Citizen_Science_SDK.ipynb #40

Closed jsv1206 closed 1 year ago

jsv1206 commented 1 year ago

Describe the bug Checking PEP8 coding style in variable_stars.ipynb following instructions from Section 3.8 in https://rtn-045.lsst.io/#jupyter-notebook-format-style-and-code-standards

I get the error in %run Citizen_Science_SDK.ipynb cell

To Reproduce Steps to reproduce the behavior, written in imperative mood:

  1. Go to 'variable_stars' branch
  2. Click on 'variable_stars.ipynb'
  3. Scroll down to '%run Citizen_Science_SDK.ipynb' cell
  4. See error
ericdrosas87 commented 1 year ago

I'm just starting to take a look at this now, will provide an update after I've done some research

ericdrosas87 commented 1 year ago

@jsv1206 Can you post a screenshot of the error you are seeing?

jsv1206 commented 1 year ago

Attached is the error I get. flake8_error_1 flake8_error_2 flake8_error_3

ericdrosas87 commented 1 year ago

After troubleshooting with @jsv1206 , the resolution was to include the following two lines in both the first cell of the SDK notebook AND the cell of the variable stars notebook that imports the SDK notebook:

%load_ext pycodestyle_magic
%flake8_on

It is unclear why these lines need to be repeated or if this is intended behavior of the Flake8 or PEP package. Further research/discovery is needed to make that determination, but Sree should now be unblocked from her work.

jsv1206 commented 1 year ago

This issue is resolved by including the following in the SDK notebook. This has to be in the same first cell as the other installations.

%load_ext pycodestyle_magic %flake8_on

Include the following in the Testing or variable_stars notebook. This has to be in the first cell with log in details to Zooniverse.

%load_ext pycodestyle_magic %flake8_on import logging logging.getLogger("flake8").setLevel(logging.FATAL)

jsv1206 commented 1 year ago

SDK notebook cell: SDK_notebook

Main notebook cell: main_notebook