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

Fix a type error in ProjectManager's report() function #160

Conversation

n8downs
Copy link
Contributor

@n8downs n8downs commented Dec 1, 2023

I wanted to introspect the state of my ProjectManager via bw2data.projects.report() as recommended in ProjectManager#__repr__(), but I hit the following error.

    sum(os.path.getsize(root / name) for name in files)
TypeError: unsupported operand type(s) for /: 'str' and 'str'

Looks like a pretty straightforward issue of using pathlib operators where actually we have strings. I've switched to use Path() and updated test_report to a minimum characterization test that runs the function.

I've also added the steps I took to get the environment off the ground to the README, since it wasn't clear (maybe it would be obvious to a more practiced python developer). Feel free to omit that if it's inappropriate or incorrect.

@n8downs n8downs changed the title N8downs/fix type error in project manager report Fix a type error in ProjectManager's report() function Dec 1, 2023
@cmutel cmutel merged commit 02abbcf into brightway-lca:main Dec 3, 2023
1 check passed
@cmutel
Copy link
Member

cmutel commented Dec 3, 2023

Nice, thanks!

@cmutel
Copy link
Member

cmutel commented Dec 3, 2023

@n8downs Could you reach out to me at cmutel@gmail.com? I would love to hear about what someone with your background in doing in the sustainability space, and explore opportunities for collaboration.

@haaami01
Copy link

haaami01 commented Jan 7, 2024

@cmutel thanks for the great link

@n8downs n8downs deleted the n8downs/fix-type-error-in-project-manager-report branch January 23, 2024 16:03
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

Successfully merging this pull request may close these issues.

None yet

3 participants