Skip to content
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

Error: Is it possible the key isn't correct. #530

Open
crcrewso opened this issue Nov 27, 2024 · 0 comments
Open

Error: Is it possible the key isn't correct. #530

crcrewso opened this issue Nov 27, 2024 · 0 comments

Comments

@crcrewso
Copy link
Contributor

data["X Metrics"].pop("values")
data["Y Metrics"].pop("values")

In Pylinac 3.29, when trying to publish a pdf of an open flat field with the FieldProfileAnalysis module the following error is produced.

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[3], [line 4](vscode-notebook-cell:?execution_count=3&line=4)
      [2](vscode-notebook-cell:?execution_count=3&line=2) OFanalysis.analyze()
      [3](vscode-notebook-cell:?execution_count=3&line=3) print(OFanalysis.results())
----> [4](vscode-notebook-cell:?execution_count=3&line=4) OFanalysis.publish_pdf(os.path.join(os.getcwd(), 'OpenFieldProfile.pdf'))

File c:\Users\cody.crewson\Source\Github\Jupyter-Workspaces\.venv\Lib\site-packages\pylinac\field_profile_analysis.py:414, in FieldProfileAnalysis.publish_pdf(self, filename, notes, open_file, metadata, logo, plot_kwargs)
    [410](file:///C:/Users/cody.crewson/Source/Github/Jupyter-Workspaces/.venv/Lib/site-packages/pylinac/field_profile_analysis.py:410) data = self.results_data(
    [411](file:///C:/Users/cody.crewson/Source/Github/Jupyter-Workspaces/.venv/Lib/site-packages/pylinac/field_profile_analysis.py:411)     as_dict=True, by_alias=True, exclude={"pylinac_version"}
    [412](file:///C:/Users/cody.crewson/Source/Github/Jupyter-Workspaces/.venv/Lib/site-packages/pylinac/field_profile_analysis.py:412) )
    [413](file:///C:/Users/cody.crewson/Source/Github/Jupyter-Workspaces/.venv/Lib/site-packages/pylinac/field_profile_analysis.py:413) # drop values; that's too much info
--> [414](file:///C:/Users/cody.crewson/Source/Github/Jupyter-Workspaces/.venv/Lib/site-packages/pylinac/field_profile_analysis.py:414) data["X Metrics"].pop("values")
    [415](file:///C:/Users/cody.crewson/Source/Github/Jupyter-Workspaces/.venv/Lib/site-packages/pylinac/field_profile_analysis.py:415) data["Y Metrics"].pop("values")
    [416](file:///C:/Users/cody.crewson/Source/Github/Jupyter-Workspaces/.venv/Lib/site-packages/pylinac/field_profile_analysis.py:416) offset = 0

KeyError: 'X Metrics'
crcrewso added a commit to crcrewso/pylinac that referenced this issue Nov 27, 2024
crcrewso added a commit to crcrewso/pylinac that referenced this issue Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant