MEDfl 0.1.17__py3-none-any.whl → 0.1.19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Medfl/NetManager/database_connector.py +9 -11
- {Medfl-0.1.17.dist-info → Medfl-0.1.19.dist-info}/METADATA +1 -1
- {Medfl-0.1.17.dist-info → Medfl-0.1.19.dist-info}/RECORD +6 -6
- {Medfl-0.1.17.data → Medfl-0.1.19.data}/scripts/setup_mysql.sh +0 -0
- {Medfl-0.1.17.dist-info → Medfl-0.1.19.dist-info}/WHEEL +0 -0
- {Medfl-0.1.17.dist-info → Medfl-0.1.19.dist-info}/top_level.txt +0 -0
@@ -4,12 +4,11 @@ from configparser import ConfigParser
|
|
4
4
|
|
5
5
|
import subprocess
|
6
6
|
|
7
|
-
|
8
7
|
class DatabaseManager:
|
9
8
|
def __init__(self):
|
10
9
|
|
11
|
-
from Medfl.LearningManager.utils import
|
12
|
-
db_config =
|
10
|
+
from Medfl.LearningManager.utils import load_db_config
|
11
|
+
db_config = load_db_config()
|
13
12
|
if db_config:
|
14
13
|
self.config = db_config
|
15
14
|
else:
|
@@ -18,8 +17,7 @@ class DatabaseManager:
|
|
18
17
|
|
19
18
|
def connect(self):
|
20
19
|
if not self.config:
|
21
|
-
raise ValueError(
|
22
|
-
"Database configuration not loaded. Use load_config() or set_config_path() first.")
|
20
|
+
raise ValueError("Database configuration not loaded. Use load_db_config() or set_config_path() first.")
|
23
21
|
connection_string = (
|
24
22
|
f"mysql+mysqlconnector://{self.config['user']}:{self.config['password']}@"
|
25
23
|
f"{self.config['host']}:{self.config['port']}/{self.config['database']}"
|
@@ -30,21 +28,21 @@ class DatabaseManager:
|
|
30
28
|
if not self.engine:
|
31
29
|
self.connect()
|
32
30
|
return self.engine.connect()
|
33
|
-
|
34
|
-
def create_MEDfl_db(self, path_to_csv):
|
31
|
+
|
32
|
+
def create_MEDfl_db(self , path_to_csv):
|
35
33
|
# Get the directory of the current script
|
36
34
|
current_directory = os.path.dirname(__file__)
|
37
35
|
|
38
36
|
# Define the path to the create_db.py script
|
39
|
-
create_db_script_path = os.path.join(
|
40
|
-
current_directory, '..', '..', 'scripts', 'create_db.py')
|
37
|
+
create_db_script_path = os.path.join(current_directory, '..', 'scripts', 'create_db.py')
|
41
38
|
|
42
39
|
# Execute the create_db.py script
|
43
|
-
subprocess.run(
|
44
|
-
['python', create_db_script_path, path_to_csv], check=True)
|
40
|
+
subprocess.run(['python', create_db_script_path, path_to_csv], check=True)
|
45
41
|
|
46
42
|
return
|
47
43
|
|
48
44
|
def close(self):
|
49
45
|
if self.engine:
|
50
46
|
self.engine.dispose()
|
47
|
+
|
48
|
+
|
@@ -12,21 +12,21 @@ Medfl/LearningManager/server.py,sha256=iQYiWFWMh9FdyQfNoAGYZ7l67fY4lB0dwICgnDXPO
|
|
12
12
|
Medfl/LearningManager/strategy.py,sha256=n0asQajkHfGLDX3QbbV5qntQA-xuJZU8Z92XccZENsA,3517
|
13
13
|
Medfl/LearningManager/utils.py,sha256=80yWwpjVsQbYdjpzu5q_mpi6YWpEQUdPhSUdXGK9gx0,9339
|
14
14
|
Medfl/NetManager/__init__.py,sha256=htCEy8g7lrKKeZJ-cH9-YCTyWfIOLwKtoj_dlNasOuM,246
|
15
|
-
Medfl/NetManager/database_connector.py,sha256=
|
15
|
+
Medfl/NetManager/database_connector.py,sha256=rooasWBSNtZZmqQvLPS0IimHQqWeCMyyGFRFzNM8Dlw,1538
|
16
16
|
Medfl/NetManager/dataset.py,sha256=NpbmfSKJdtqIsShvjsb_z8W1vqlpYoFyZp8Wzsx_aEc,2869
|
17
17
|
Medfl/NetManager/flsetup.py,sha256=IPWdZcz13PZic5OQyCiMyJ34cQPegKwkKEJSAqjjnqg,11754
|
18
18
|
Medfl/NetManager/net_helper.py,sha256=VYJPVI65wo34X9GO9t1joNGPr3TutZdxfva-X6P3MSU,7017
|
19
19
|
Medfl/NetManager/net_manager_queries.py,sha256=2dfhba0iuh40kVoC7am-vC4Hlrvr-zfJ5ESymsI1Kps,4327
|
20
20
|
Medfl/NetManager/network.py,sha256=dzSyEv0IFcoAFeXnI4Favhe9aHuw18YZHB9zwm0VwZE,5521
|
21
21
|
Medfl/NetManager/node.py,sha256=c1vxcpzZFRV0KeG7KLBtP_sA_VmTdjG93PWUpGNIsKM,6535
|
22
|
-
Medfl-0.1.
|
22
|
+
Medfl-0.1.19.data/scripts/setup_mysql.sh,sha256=PXl271yvYBrXwrZ7P0tsYHnGkOubKvRaFee4MnzsSko,560
|
23
23
|
alembic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
alembic/env.py,sha256=a4zJAzPNLHnIrUlXCqf_8vuAlFu0pceFJJKM1PQaOI4,1649
|
25
25
|
scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
26
|
scripts/base.py,sha256=B0KKbl9Czh4HhExmO41tdbI2-g1OyiW2ArYhLYgKNEw,778
|
27
27
|
scripts/config.ini,sha256=tDQQlpwZbCFQuSS017yjEiLglLihp6wETbWtNrSWeAA,82
|
28
28
|
scripts/create_db.py,sha256=ZoQeXIPRBxpcMX6wgQSUKCHzxg3kixzBz0ysTGpAejs,4461
|
29
|
-
Medfl-0.1.
|
30
|
-
Medfl-0.1.
|
31
|
-
Medfl-0.1.
|
32
|
-
Medfl-0.1.
|
29
|
+
Medfl-0.1.19.dist-info/METADATA,sha256=LJ6RCkIuFNzlkH8ydH1gZ2Mee6RGoR1LwlwtvhYMYu4,5577
|
30
|
+
Medfl-0.1.19.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
31
|
+
Medfl-0.1.19.dist-info/top_level.txt,sha256=CmLt1TC7PJj-V55rhffMZ9LSOiuSaaEbz9FJm_zOw_E,22
|
32
|
+
Medfl-0.1.19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|