Skip to content

Commit

Permalink
readme text improve, fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-SGXXX committed Dec 4, 2024
1 parent 63d3f0b commit d55bde6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Export the content of a SQLite database to an Excel file and the result images (
export_zip db_path(default ~/experiment.db) output_dir(default ./)
```
### db_merge
Merge two SQLite databases. The two database must have the same structure for current version.
Merge the second db to the first db SQLite databases. The two database must have the same structure for current version.
```shell
db_merge db_path_destination db_path_source
```
Expand Down Expand Up @@ -87,9 +87,9 @@ The only necessary column for detail table is the detail id (which can be set au
# Future Plan

- [x] Web UI Visualization
- [x] Commonly Used Analyze Tools
- [ ] Experiment Summary Report Generate
- [ ] Commonly Used Analyze Fuctions
- [ ] Bug fix & performence improving
- [ ] Bug fix & performance improving

# Contact
My email is [email protected]. If you have any question or advice, please contact me.
6 changes: 3 additions & 3 deletions pyerm/database/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ExperimentTable(Table):
def __init__(self, db: Database) -> None:
columns = {
'id': 'INTEGER PRIMARY KEY AUTOINCREMENT',
'remark': 'TEXT DEFAULT NULL UNIQUE',
'description': 'TEXT DEFAULT NULL',
'method': 'TEXT NOT NULL',
'method_id': 'INTEGER NOT NULL',
Expand All @@ -50,7 +51,6 @@ def __init__(self, db: Database) -> None:
'useful_time_cost': 'REAL DEFAULT NULL',
'total_time_cost': 'REAL AS (strftime(\"%s\", end_time) - strftime(\"%s\", start_time)) VIRTUAL',
'status': 'TEXT CHECK(status IN (\"running\", \"finished\", \"failed\"))',
'remark': 'TEXT DEFAULT NULL UNIQUE',
'failed_reason': 'TEXT DEFAULT NULL',
}
super().__init__(db, "experiment_list", columns)
Expand Down Expand Up @@ -95,8 +95,8 @@ def __init__(self, db: Database, data: str, param_def_dict: dict=None) -> None:
assert param_def_dict is not None, 'Data Parameter Dict must be provided when creating a new data table'
columns = {
'data_id': 'INTEGER PRIMARY KEY AUTOINCREMENT',
**param_def_dict,
'remark': 'TEXT DEFAULT NULL UNIQUE',
**param_def_dict,
}
super().__init__(db, table_name, columns)
# if len(param_def_dict) != 0:
Expand Down Expand Up @@ -130,8 +130,8 @@ def __init__(self, db: Database, method: str, param_def_dict: dict=None) -> None
assert param_def_dict is not None, 'Method Parameter Dict must be provided when creating a new parameter table'
columns = {
'method_id': 'INTEGER PRIMARY KEY AUTOINCREMENT',
**param_def_dict,
'remark': 'TEXT DEFAULT NULL UNIQUE',
**param_def_dict,
}
super().__init__(db, table_name, columns)
# if len(param_def_dict) != 0:
Expand Down
2 changes: 1 addition & 1 deletion pyerm/database/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def value2def(v):
elif isinstance(v, str):
return 'TEXT'
elif isinstance(v, bool):
return f'INTEGER CHECK({k} IN (0, 1))'
return f'INTEGER CHECK({v} IN (0, 1))'
elif isinstance(v, bytes) or isinstance(v, bytearray):
return 'BLOB'
else:
Expand Down
9 changes: 5 additions & 4 deletions pyerm/webUI/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def single_setting_analysis(db, task, method, method_id, dataset, dataset_id):
st.dataframe(result_statistics, use_container_width=True)
st.write(f"_**Notice**: The statistics are calculated based on the **{num_records}** same setting experiments._")
else:
st.write('No statistics results found for this setting.')
st.write('No results found for this setting.')
return
remarked_list = db[f'experiment_list'].select('remark', where=f'id in ({",".join(same_setting_ids)}) AND remark IS NOT NULL')
remarked_list = [remark[0] for remark in remarked_list]
# remarked_list = []
Expand Down Expand Up @@ -487,7 +488,7 @@ def boxplot(df:pd.DataFrame, x:str, y:str, title:str='', figsize=(10, 6), **addi
additional_params_dict['palette'] = 'Set2'
if 'linewidth' not in additional_params_dict:
additional_params_dict['linewidth'] = 2.5
sns.boxplot(data=df, x=x, y=y, ax=ax, **additional_params_dict)
sns.boxplot(data=df, hue=x, x=x, y=y, ax=ax, **additional_params_dict)
if title != '':
ax.set_title(title, fontsize=16)
ax.set_xlabel(x, fontsize=14)
Expand All @@ -504,7 +505,7 @@ def violinplot(df:pd.DataFrame, x:str, y:str, title:str='', figsize=(10, 6), **a
additional_params_dict['palette'] = 'Set2'
if 'linewidth' not in additional_params_dict:
additional_params_dict['linewidth'] = 2.5
sns.violinplot(data=df, x=x, y=y, ax=ax, **additional_params_dict)
sns.violinplot(data=df, hue=x, x=x, y=y, ax=ax, **additional_params_dict)
if title != '':
ax.set_title(title, fontsize=16)
ax.set_xlabel(x, fontsize=14)
Expand Down Expand Up @@ -538,7 +539,7 @@ def barplot(df:pd.DataFrame, x:str, y:str, title:str='', figsize=(10, 6), **addi
additional_params_dict['palette'] = 'Set2'
if 'linewidth' not in additional_params_dict:
additional_params_dict['linewidth'] = 2.5
sns.barplot(data=df, x=x, y=y, ax=ax, **additional_params_dict)
sns.barplot(data=df, hue=x, x=x, y=y, ax=ax, **additional_params_dict)
if title != '':
ax.set_title(title, fontsize=16)
ax.set_xlabel(x, fontsize=14)
Expand Down
4 changes: 2 additions & 2 deletions pyerm/webUI/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def main():
page = st.sidebar.radio("Page to select:", ["Home", "Recording", "Details", "Analysis", "Tables"], index=0)
if page == "Home":
home()
# elif page == "Recording":
# record()
elif page == "Recording":
record()
elif page == "Details":
details()
elif page == "Analysis":
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"xlsxwriter",
"numpy",
"matplotlib",
"seaborn",
"streamlit>=1.39.0"
],
python_requires='>=3.9',
Expand Down

0 comments on commit d55bde6

Please sign in to comment.