Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Issues with database and threading #221

Open
RuizSerra opened this issue Jan 22, 2024 · 3 comments
Open

Issues with database and threading #221

RuizSerra opened this issue Jan 22, 2024 · 3 comments

Comments

@RuizSerra
Copy link
Contributor

I am facing the following issue in both macOS 14.0 (M1) and Ubuntu 22.04.3 LTS.

(abce) jaime@OptiPlex-7000:~/Documents
 $ pypy3
pypy3: /home/jaime/miniconda3/envs/abce/bin/../lib/./libtinfow.so.6: no version information available (required by /home/jaime/miniconda3/envs/abce/bin/../lib/libpypy3.9-c.so)
Python 3.9.18 | packaged by conda-forge | (c5262994, Oct 26 2023, 08:28:20)
[PyPy 7.3.13 with GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>>> import abcEconomics as abce

>>>> simulation = abce.Simulation()

>>>> Exception in thread Thread-1:
                                  Traceback (most recent call last):
                                                                      File "/home/jaime/miniconda3/envs/abce/lib/pypy3.9/threading.py", line 980, in _bootstrap_inner
           self.run()
                       File "/home/jaime/miniconda3/envs/abce/lib/pypy3.9/site-packages/abcEconomics/logger/db.py", line 74, in run
                                                                                                                                       self.dataset_db.query('PRAGMA synchronous=OFF')
                          File "/home/jaime/miniconda3/envs/abce/lib/pypy3.9/site-packages/dataset/persistence/database.py", line 287, in query
                                                                                                                                                   return ResultIter(self.executable.execute(query, **kw),
                                              File "/home/jaime/miniconda3/envs/abce/lib/pypy3.9/site-packages/dataset/persistence/util.py", line 66, in __init__
       self.keys = list(result_proxy.keys())
                                              File "/home/jaime/miniconda3/envs/abce/lib/pypy3.9/site-packages/sqlalchemy/engine/result.py", line 906, in keys
    return self._metadata.keys
                                File "/home/jaime/miniconda3/envs/abce/lib/pypy3.9/site-packages/sqlalchemy/engine/cursor.py", line 1366, in keys
                                                                                                                                                     self._we_dont_return_rows()
                    File "/home/jaime/miniconda3/envs/abce/lib/pypy3.9/site-packages/sqlalchemy/engine/cursor.py", line 1338, in _we_dont_return_rows
                                                                                                                                                         raise exc.ResourceClosedError(
                         sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically.
@rht
Copy link
Member

rht commented Jan 22, 2024

The logging to an SQLite DB is probably overkill when done by default for a simple initialization, and should be disabled

@rht
Copy link
Member

rht commented Jan 23, 2024

The tests used to pass, but the library hasn't been maintained for years, and the dataset requirement is pinned to be too outdated. I tried a fix at #222, but at this point, I'd recommend using https://github.com/projectmesa/mesa, which I actively help maintain.

@RuizSerra
Copy link
Contributor Author

Thanks @rht, I have used MESA before and really enjoyed it. I might settle for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants