PastaStore and Connector names and logical defaults
dbrakenhoff opened this issue · comments
The PastaStore object now takes a name, which is not something that's really used, so we could default to the connector name and optionally let users pass their own.
The Connectors now take a name and some take a path/connection string. This is not implemented consistently, and also doesn´t make sense for all connectors.
- ArcticConnector requires a unique name to create a library with that name.
- PystoreConnector I think also requires a name to create a database in a certain folder.
- PasConnector requires a path but does not use the name, it would probably make more sense to pass a directory in which a folder with the provided name is created, more in line with the other two connectors.
- DictConnector takes a name argument for consistency reasons but my proposal would be to set a default name.
I'm not sure how to make these changes without breaking some old code (for PasConnector), but I think would be good to implement sooner rather than later.
This is now dealt with in #88.
DictConnector
now gets a default name and doesn't necessarily need to be passed by user. It's not used for anything anyway, so a default value makes creating a DictConnector easier.PasConnector
now actually uses thename
argument as the name of the directory in which the data will be stored. Thepath
argument is now the location where to create/read that directory. This is a breaking change, see instructions below.PastaStore
now expects theConnector
object as the first argument. Thename
argument is now optional, if it is not provided, it will take the name from the Connector object.
WARNING! This change will introduce two breaking changes:
- This does introduce a breaking change, where people with old code will have to switch the order of the arguments from
pst.PastaStore(name, connector)
topst.PastaStore(connector, name=name)
with the name becoming optional. - Also in
pst.PasConnector
the name argument is now used to specify the directory name in which the database will be stored. The path argument defines the location of that directory. This is also a breaking change and will require users to modify theirPasConnector
frompst.PasConnector("unused_name", path="./pastas_db")
topst.PasConnector("pastas_db", path=".")
. This is more in line with the other Connectors.