You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling this method with a non-existent directory name, the code attempts to loop over that directory to build a list of available examples. It should instead loop over the root of the examples directory.
defexample_dir(example_name: str):
"""Takes an example name and returns the directory. Args: example_name: name of example """package_dir=os.path.dirname(os.path.abspath(__file__))
main_example_dir=os.path.join(os.path.dirname(package_dir), "examples")
example_dir=os.path.join(main_example_dir, example_name)
ifnotos.path.exists(example_dir):
available_examples= [
namefornameinos.listdir(example_dir) ifos.path.isdir(name) #<---- error here
]
Thoughts on resolution
defexample_dir(example_name: str):
"""Takes an example name and returns the directory. Args: example_name: name of example """package_dir=os.path.dirname(os.path.abspath(__file__))
main_example_dir=os.path.join(os.path.dirname(package_dir), "examples")
example_dir=os.path.join(main_example_dir, example_name)
ifnotos.path.exists(example_dir):
available_examples= [
namefornameinos.listdir(main_example_dir) ifos.path.isdir(name) #<---- os.listdir(main_example_dir)
]
Full stack trace
The text was updated successfully, but these errors were encountered:
Describe the bug
When calling this method with a non-existent directory name, the code attempts to loop over that directory to build a list of available examples. It should instead loop over the root of the examples directory.
To Reproduce
See the Run output from the
Python package
GitHub ActionFailing tests
tests/test_basic.py:test_csv_io()
Triggering line of code
transitstacks/io.py:139
:Thoughts on resolution
Full stack trace
The text was updated successfully, but these errors were encountered: