Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

63 add database logging functionality #84

Merged
merged 29 commits into from
Apr 2, 2023

Conversation

LukasFehring
Copy link
Collaborator

No description provided.

@LukasFehring LukasFehring force-pushed the 63-add-database-logging-functionality branch from c23c6f4 to d4002e5 Compare January 11, 2023 15:37
@tornede tornede force-pushed the 63-add-database-logging-functionality branch from d4002e5 to 7ae7f8b Compare January 12, 2023 09:36
@tornede tornede linked an issue Jan 12, 2023 that may be closed by this pull request
Copy link
Owner

@tornede tornede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There are warnings in the mysql view of all tables, which should be removed/solved.
  • The LogTables are missing the timestamp column as noted in the issue
  • The order of the columns should be:
    1. ID
    2. experiment_id
    3. timestamp
    4. other columns in order of the config file

@LukasFehring LukasFehring force-pushed the 63-add-database-logging-functionality branch from 7ae7f8b to 6f83802 Compare January 16, 2023 09:58
Lukas Fehring and others added 11 commits January 16, 2023 11:09
@LukasFehring LukasFehring force-pushed the 63-add-database-logging-functionality branch from 6f83802 to 9acddc4 Compare January 16, 2023 10:09
Lukas Fehring added 4 commits January 16, 2023 11:11
Move timestamp handling to database_connector whenever possible.
Introduce utils.get_timestamp_representation to remove duplicated code.
@LukasFehring
Copy link
Collaborator Author

LukasFehring commented Jan 16, 2023

  • There are warnings in the mysql view of all tables, which should be removed/solved.

These warnings seem to get caused by the database connection to a 'modern' database. Therefore the comment should be moved to #61 .

The dependency is used for several tests.
Copy link
Owner

@tornede tornede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Update documentation

@alexandertornede
Copy link
Collaborator

So I tried using the new functionality in one of the examples and I have two problems with running the examples in the first place:

  1. The cell writing the example config fails, if the config folder does not already exists. Thus, it should be created, if it does not exist yet.
  2. When running the cell executing the PyExperimenter, I get the following error:
    AttributeError: Can't get attribute 'run_ml' on <module '__main__' (built-in)>

@LukasFehring
Copy link
Collaborator Author

LukasFehring commented Feb 22, 2023

  1. The cell writing the example config fails, if the config folder does not already exists. Thus, it should be created, if it does not exist yet.

This is updated

  1. When running the cell executing the PyExperimenter, I get the following error:
    AttributeError: Can't get attribute 'run_ml' on <module '__main__' (built-in)>

I can not reproduce this error.

@LukasFehring LukasFehring force-pushed the 63-add-database-logging-functionality branch from 93afbd5 to 0560ee4 Compare February 23, 2023 16:55
@LukasFehring LukasFehring force-pushed the 63-add-database-logging-functionality branch from 5f0d299 to ee57a23 Compare February 23, 2023 16:58
@LukasFehring
Copy link
Collaborator Author

I also added documentation and an example notebook. Note that this branch is checked out before #87 is merged into develop. Therefore, we must manually add string identifiers when writing a string into a log-table. This should be fixed by closing the aforementioned issue

@alexandertornede
Copy link
Collaborator

alexandertornede commented Mar 24, 2023

@LukasFehring

I retried running the examples and it still fails for me. Steps to reproduce on a MAC with Mac OS Monterey (12.6):

  1. Install the environment.
  2. Open the project in Pycharm (2022.2.4) and run any of the example notebooks in Pycharm from top to bottom. The cell with experimenter.execute... gives the following error:
    Process SpawnPoolWorker-2: Traceback (most recent call last): File "/Users/.../anaconda3/envs/pyexperimenter/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/Users/.../anaconda3/envs/pyexperimenter/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/Users/.../anaconda3/envs/pyexperimenter/lib/python3.9/multiprocessing/pool.py", line 114, in worker task = get() File "/Users/.../anaconda3/envs/pyexperimenter/lib/python3.9/multiprocessing/queues.py", line 367, in get return _ForkingPickler.loads(res) AttributeError: Can't get attribute 'run_ml' on <module '__main__' (built-in)>

I shortened some of the paths in the above error.

Edit: I also get the same error when running it outside of Pycharm.

@LukasFehring
Copy link
Collaborator Author

T

@LukasFehring

I retried running the examples and it still fails for me. Steps to reproduce on a MAC with Mac OS Monterey (12.6):

  1. Install the environment.
  2. Open the project in Pycharm (2022.2.4) and run any of the example notebooks in Pycharm from top to bottom. The cell with experimenter.execute... gives the following error:
    Process SpawnPoolWorker-2: Traceback (most recent call last): File "/Users/.../anaconda3/envs/pyexperimenter/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/Users/.../anaconda3/envs/pyexperimenter/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/Users/.../anaconda3/envs/pyexperimenter/lib/python3.9/multiprocessing/pool.py", line 114, in worker task = get() File "/Users/.../anaconda3/envs/pyexperimenter/lib/python3.9/multiprocessing/queues.py", line 367, in get return _ForkingPickler.loads(res) AttributeError: Can't get attribute 'run_ml' on <module '__main__' (built-in)>

I shortened some of the paths in the above error.

Edit: I also get the same error when running it outside of Pycharm.

This prompted us to use joblib instead of pytons own multiprocessing. The issue #102 deals with this. It is finished but needs to merged on dev.

@alexandertornede
Copy link
Collaborator

With the fixes from the other branch and the adapted usage and example documentation, it looks good to me now.

Copy link
Owner

@tornede tornede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tornede tornede merged commit 4ffb5c5 into develop Apr 2, 2023
@tornede tornede deleted the 63-add-database-logging-functionality branch April 2, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Database Logging Functionality
3 participants