Missing/ incorrect imports
Hi there!
When trying to use carputils
to read some files, I had some issues:
Summary
Some (sub)modules of carputils
appear not to be imported correctly, so that they can be imported as
from carputils.<module> import <submodule>
or
from carputils import <module>
but not used as
import carputils
carputils.<module>.function(*args, **kwargs)
What version of carputils and/or openCARP are you using?
Version: 0.0.0 (there also seems to be a versioning issue...)
inga@cerridwen:openCARP_Singularity$ singularity shell opencarp_deb.sif
Apptainer> pip show carputils
Name: carputils
Version: 0.0.0
Summary: carputils is a Python framework for generating and running openCARP examples.
Home-page: https://git.opencarp.org/openCARP/carputils
Author:
Author-email:
License: Apache 2.0
Location: /usr/local/lib/python3.10/dist-packages
Requires: common, matplotlib, numpy, pandas, pyDOE, python-dateutil, ruamel.yaml, scipy, setuptools, six, tables
Required-by:
What operating system and processor architecture are you using?
(singularity container instead of classic docker because security)
- OS
Apptainer> uname -a Linux cerridwen 5.19.0-38-generic #39~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 17 21:16:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
- processor
Apptainer> uname -p x86_64
Steps to reproduce
- Install
carputils
from this repository - open a python shell, try to access
carputils.carpio
after only importingcarputils
. It won't work. (same forcarputils.carpio.sv
, maybe also other submodules, I didn't check)
What is the current bug behavior?
Some (sub)modules are not accessible after import carputils
What is the expected correct behavior?
All (sub)modules are accesible after import carputils
Relevant logs and/or screenshots
Apptainer> python
Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import carputils
>>> f = carputils.carpio.igb.open('vm.igb')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'carputils' has no attribute 'carpio'
>>> from carputils import carpio
>>> carpio.igb.open('vm.igb')
<carputils.carpio.igb.IGBFile object at 0x7f52f45891b0>
Possible fixes
import all python files in the respective __init__.py
.