Open AAndersn opened 9 months ago
I suspect that the root cause of your problem is that ditto is downloading an mdbtools package that is incompatible with your Linux system. Would you be willing to try a workaround? You may be able to install mdbtools manually and then change the ditto source code to use those binaries instead of the ones downloaded by ditto.
$ apt install mdbtools
Open ~/ditto/ditto/readers/synergi/pandas_access.py
. Replace every use of path_to_mdbtools
with only the executable. All executables should be in your system path. For example, line 43 should be changed
from
tables = subprocess.check_output(
[os.path.join(path_to_mdbtools, "mdb-tables"), rdb_file]
).decode(encoding)
to
tables = subprocess.check_output(
["mdb-tables", rdb_file]
).decode(encoding)
Note that you may be the first person to use this version of mdbtools with ditto, and there could be unexpected results.
The solution worked, not getting the libmdb errors anymore. Now, ditto is looking for warehouse.mdb which we do not have.
The solution worked, not getting the libmdb errors anymore. Now, ditto is looking for warehouse.mdb which we do not have.
The warehouse.mdb is a file which has all the component specs that is referenced by the other mdb files. It may be named something different in your setup, but should contain tables starting with the name Dev. For example DevConductors would list all the conductor types used in the model and their specifications.
This example in the code should fix the issue once you identify your warehouse file.
"""
Synergi Reader class.
**Usage:**
- With only one MDB database holding everything:
>>> r = Reader(input_file="path_to_your_mdb_file")
>>> r.parse(m)
- With an additional MDB database for the Warehouse:
>>> r = Reader(input_file="path_to_your_mdb_file", warehouse="path_to_your_warehouse_mdb_file")
>>> r.parse(m)
Is there any synergi test system that could be used to test the conversion? I only have one mdb file that all the tables regarding feeder information.
I don’t see any synergi test systems in the repo.
Are you still getting an error for warehouse.mdb
? I think there is another error path. Are you creating a Reader
as in the example above or are you using the ditto CLI command for convert? If you are using the CLI then the problem is likely this line: https://github.com/NREL/ditto/blob/master/ditto/converter.py#L150. It will force the reader to look for warehouse.db
when that file is not needed.
Thanks Dan. I tried commenting that line but I see in https://github.com/NREL/ditto/blob/41b93f954af5836cbe5986add0c104b19dc22fde/ditto/readers/synergi/db_parser.py#L36 warehouse is used everywhere and ditto-cli still throws this error:
shared_user@gridatlas-pnnl-internal:~$ ditto-cli convert --from synergi --input /home/shared_user/grid_atlas_models/input_models/synergi/pnnlcampus/FeederModels.mdb --to opendss --output ./
Log file currently not supported, please contact the developers for information on how to generate log files
Opening synergie database - /home/shared_user/grid_atlas_models/input_models/synergi/pnnlcampus/FeederModels.mdb
Opening warehouse database - /home/shared_user/grid_atlas_models/input_models/synergi/pnnlcampus/warehouse.mdb
File not found
Couldn't open database.
Traceback (most recent call last):
File "/home/shared_user/.local/bin/ditto-cli", line 33, in
Yeah, there are more bugs here. The warehouse file needs to exist.
You can use synergi software to load in your single mbd file, then save to warehouse.mdb. Then use the newly saved file in the conversion process.
Unable to convert from synergi to opendss using ditto-cli or python library.
Machine: Ubuntu 22.04
Ditto Branch: tried with both fuse_wenbo and synergi_read_fixes
Models: PNNL Campus and Nantucket (private models)
Error message:
Have attempted to force installation of libmdb2 but library no longer exists. Options through apt-get are libdmb3 and mdbtools