xapple / plumbing Goto Github PK
View Code? Open in Web Editor NEWHelps with plumbing-type programing in python.
License: MIT License
Helps with plumbing-type programing in python.
License: MIT License
ipdb> db_v1 = SQLiteDatabase(db_path_v1)
*** TypeError: argument of type 'PosixPath' is not iterable
ipdb> str(db_path_v1)
'/home/paul/repos/eu_cbm/eu_cbm_aidb/countries/SI/aidb_v1.db'
Longer stack trace of the error in that case:
File ~/eu_cbm/eu_cbm_hat/scripts/conversion/update_aidb_1x_to_2x.py:66, in convert_aidb_to_v2(db_path)
64 # Rename the old AIDB to v1
65 shutil.copy(db_path, db_path_v1)
---> 66 # Remove the "index" column in the disturbance_matrix_value table.
67 # This was introduced by mistake and shouldn't be there.
68 db_v1 = SQLiteDatabase(db_path_v1)
69 dm_values = db_v1.read_df("disturbance_matrix_value")
File ~/repos/autopaths/autopaths/base_path.py:60, in BasePath.__new__(cls, path, *args, **kwargs)
58 def __new__(cls, path, *args, **kwargs):
59 """A Path object is in fact a string."""
---> 60 return str.__new__(cls, cls.clean_path(path))
File ~/repos/autopaths/autopaths/base_path.py:38, in BasePath.clean_path(cls, path)
36 if hasattr(path, 'path'): path = path.path
37 # Expand the tilda #
---> 38 if "~" in path: path = os.path.expanduser(path)
39 # We will store the path with the OS specific separator #
40 # We will never mix both kinds of separators #
41 if os.name == "posix": path = path.replace("\\", sep)
TypeError: argument of type 'PosixPath' is not iterable
Easily fixed by converting to a string
ipdb> db_v1 = SQLiteDatabase(str(db_path_v1))
But the error message "TypeError: argument of type 'PosixPath' is not iterable" is confusing at first.
The "argument of type 'PosixPath' is not iterable" is a bit confusing. Can SQLiteDatabase accept pathlib objects?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.