Skip to content

Commit

Permalink
Adding getters of available export types and exts
Browse files Browse the repository at this point in the history
  • Loading branch information
lcsrodriguez committed Jul 11, 2022
1 parent f668595 commit b59ff2d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ If you choose the cloning method, please perform a prelinimary step: installing

## Supported export formats

| Name | Extension | Description |
|-----------|--------------|-------------------------------------------------------------------------------------------------|
| Text file | .txt, .out | Standard text file |
| Excel | .xslx | MS Excel/OpenOffice Calc file |
| CSV | .csv | Better for data-science |
| JSON | .json | JSON file |
| XML | .xml | Useful for |
| Markdown | .md | Useful for quick report in Markdown |
| LaTeX | .tex | Recommended for highly-detailed article in LaTeX |
| Parquet | .pqt | [Apache Parquet](https://parquet.apache.org/) format : highly recommended for HPC |
| Pickle | .pkl | For data serialization and unserialization (could be useful for such applications) |
| SQLite | .db, .sqlite | Classic and light-weight file-based SQL RDBMS (can be relevant for requesting organized records |
| MATLAB | .mat | For heavy computations on MATLAB programs (proprietary software) |
| Name | Extension | Description |
|-----------|----------------|-------------------------------------------------------------------------------------------------|
| Text file | `.txt, .out` | Standard text file |
| Excel | `.xslx` | MS Excel/OpenOffice Calc file |
| CSV | `.csv` | Better for data-science |
| JSON | `.json` | JSON file |
| XML | `.xml` | Useful for |
| Markdown | `.md` | Useful for quick report in Markdown |
| LaTeX | `.tex` | Recommended for highly-detailed article in LaTeX |
| Parquet | `.pqt` | [Apache Parquet](https://parquet.apache.org/) format : highly recommended for HPC |
| Pickle | `.pkl` | For data serialization and unserialization (could be useful for such applications) |
| SQLite | `.db, .sqlite` | Classic and light-weight file-based SQL RDBMS (can be relevant for requesting organized records |
| MATLAB | `.mat` | For heavy computations on MATLAB programs (proprietary software) |



Expand Down
18 changes: 17 additions & 1 deletion headat/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,29 @@ def t_xlsx(self):
"""
pass

def get_total_views_counter() -> int:
def get_total_views_counter(self) -> int:
"""
Function returning the total number of views initialized
since the execution of the program
"""
return HDView.VIEWS_INITIALIZED_COUNTER

def get_export_extensions(self) -> list:
"""
Function returning the array of the currently available
extensions supported by the tool's exporter
:return: list with specific types' extensions
"""
return [AVAILABLE_EXPORT_TYPES[k]["ext"] for k in AVAILABLE_EXPORT_TYPES]

def get_export_types(self) -> list:
"""
Function returning the array of the currently available
types supported by the tool's exporter
:return: list with specific types
"""
return [k for k in AVAILABLE_EXPORT_TYPES]


"""
1 record <-> 1 or more signals
Expand Down
6 changes: 5 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
file_folder = "data/apnea-ecg-database-1.0.0/"
rec = wfdb.rdsamp(file_folder + "a01r")

print(AVAILAB)

print(rec)
a = HDView()

print(a.get_export_extensions())
print("\n")
print(a.get_export_types())

0 comments on commit b59ff2d

Please sign in to comment.