vortex icon indicating copy to clipboard operation
vortex copied to clipboard

bug: AttributeError: module 'vortex' has no attribute 'io'

Open shenlei149 opened this issue 9 months ago • 4 comments

The version of python package vertex_array is 0.25.2.

repro steps:

  1. pip3 install vortex-array
  2. python code: vortex.io

error message:

>>> vortex.io
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'vortex' has no attribute 'io'

shenlei149 avatar Mar 12 '25 12:03 shenlei149

Apologies, I didn't realise folks were making use of the Python bindings! I will bring back this behaviour.

Note also there have been other breaking changes to the Python API, mostly moving some pieces around.

gatesn avatar Mar 12 '25 12:03 gatesn

To be a little more helpful, vortex.io is now a Python package, and therefore you need to import it as from vortex import io or import vortex.io; vortex.io.blah(...)

import vortex; vortex.io only works when io is an attribute of the vortex module

gatesn avatar Mar 12 '25 15:03 gatesn

To be a little more helpful, vortex.io is now a Python package, and therefore you need to import it as from vortex import io or import vortex.io; vortex.io.blah(...)

import vortex; vortex.io only works when io is an attribute of the vortex module

Thanks~

shenlei149 avatar Mar 13 '25 05:03 shenlei149

I actually want to fix this so that import vortex; vortex.io works. I think I prefer it vs the current Python package model where you must separately import the io package!

gatesn avatar Apr 14 '25 12:04 gatesn

since @gatesn mentioned he wanted to fix, assigning to him

but @claude, maybe you want to give it a go?

blaginin avatar Jul 28 '25 20:07 blaginin

Claude finished @blaginin's task —— View jobclaude/issue-2668-20250728-2044Create PR ➔


✅ Fixed the vortex.io AttributeError issue

Todo List

  • [x] Explore the Python binding structure in /vortex-python
  • [x] Understand the current vortex module implementation
  • [x] Identify why vortex.io is not accessible as an attribute
  • [x] Implement the fix to make import vortex; vortex.io work
  • [x] Test the changes
  • [x] Run linting and checks
  • [x] Commit and push changes

Solution Implemented

The issue was that the io module wasn't imported in the main __init__.py file. I added:

  1. from . import io to the imports
  2. "io" to the __all__ list

This allows both import styles to work correctly:

  • import vortex; vortex.io.read_url(...)
  • from vortex import io; io.read_url(...)

Testing

  • ✅ Verified the fix works with a test script
  • ✅ All existing Python tests pass (38 passed, 1 skipped, 7 xfailed)
  • ✅ Clippy linting passes without warnings

Changes Made

  • File: /vortex-python/python/vortex/__init__.py
  • Change: Added import and export of the io module

claude[bot] avatar Jul 28 '25 20:07 claude[bot]