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

netcomp not working properly #290

Closed
barneydobson opened this issue Sep 25, 2024 · 15 comments · Fixed by #295, #298 or #299
Closed

netcomp not working properly #290

barneydobson opened this issue Sep 25, 2024 · 15 comments · Fixed by #295, #298 or #299
Labels
bug Something isn't working

Comments

@barneydobson
Copy link
Collaborator

Assuming have copied config and updated accordingly. @dalonsoa it'd be amazing if you could take a look please.

python -m venv ./sa_env
./sa_env/Scripts/activate.bat
pip install swmmanywhere
python -m swmmanywhere --config_path=minimum_viable_template.yml 

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\bdobson\Downloads\temp\sa_env\Lib\site-packages\swmmanywhere\__main__.py", line 8, in <module>
    from swmmanywhere import swmmanywhere
  File "C:\Users\bdobson\Downloads\temp\sa_env\Lib\site-packages\swmmanywhere\swmmanywhere.py", line 22, in <module>
    from swmmanywhere.metric_utilities import iterate_metrics, validate_metric_list
  File "C:\Users\bdobson\Downloads\temp\sa_env\Lib\site-packages\swmmanywhere\metric_utilities.py", line 21, in <module>
    import netcomp
ModuleNotFoundError: No module named 'netcomp'
@barneydobson barneydobson added the bug Something isn't working label Sep 25, 2024
@dalonsoa
Copy link
Collaborator

It seems that netcomp was included in the source application but not in the wheel, so when installed from PyPI, it is not there. Let's see what I need to do to make that happen. This will require another release, I'm affraid, and mark the previous one as wrong, so no one installs it.

@barneydobson
Copy link
Collaborator Author

OK great thanks - how do I mark as wrong?

@barneydobson
Copy link
Collaborator Author

closed by #293

@cheginit
Copy link
Collaborator

@barneydobson make sure to yank the release. Can be done by the manager of the package on https://pypi.org/ which I think is @dalonsoa?

@barneydobson
Copy link
Collaborator Author

I think @dalonsoa did 👍

@barneydobson barneydobson reopened this Sep 25, 2024
@barneydobson
Copy link
Collaborator Author

@dalonsoa new bug with the distribution:

Run if [[ "false" != 'true' ]]; then
/tmp/baipp/dist/swmmanywhere-0.1.2-py3-none-any.whl: W009: Wheel contains multiple toplevel library entries:
  netcomp/
  swmmanywhere/
Error: Process completed with exit code 1.

@cheginit
Copy link
Collaborator

You need to move the netcomp folder under swmmanywhere as a subpackage.

@dalonsoa
Copy link
Collaborator

I've just seen it, but I don't understand why that is a problem. The wheel works and it is not uncommon to distribute multiple packages together. If we move netcomp to within swmmanywhere, we need to change all of import statements for netcomp.

@barneydobson
Copy link
Collaborator Author

looking at examples - could we move both into src?

@dalonsoa
Copy link
Collaborator

That's what I was starting to think, to be honest.

@cheginit
Copy link
Collaborator

I second the src-layout (I use it for all my projects). You have to make a couple of changes to pyproject.toml for hatchling, pytest, and coverage.

@dalonsoa
Copy link
Collaborator

On it...

@barneydobson
Copy link
Collaborator Author

OK still failing: https://github.com/ImperialCollegeLondon/SWMManywhere/actions/runs/11036163538/job/30654221348

I guess we're not fixing this today - but any ideas from @cheginit or @dalonsoa are welcome!

@barneydobson
Copy link
Collaborator Author

( I will first try the suggestion here )

@barneydobson
Copy link
Collaborator Author

(nope didn't help)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants