https://github.com/wikunia/tablelogger.jl
Log tabular data in Julia
https://github.com/wikunia/tablelogger.jl
Last synced: about 2 months ago
JSON representation
Log tabular data in Julia
- Host: GitHub
- URL: https://github.com/wikunia/tablelogger.jl
- Owner: Wikunia
- License: mit
- Created: 2021-12-29T18:52:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-07T08:35:57.000Z (almost 4 years ago)
- Last Synced: 2025-01-20T06:15:14.460Z (about 1 year ago)
- Language: Julia
- Size: 136 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TableLogger
[](https://wikunia.github.io/TableLogger.jl/stable)
[](https://wikunia.github.io/TableLogger.jl/dev)
[](https://github.com/wikunia/TableLogger.jl/actions/workflows/CI.yml?query=branch%3Amain)
[](https://codecov.io/gh/wikunia/TableLogger.jl)
**TableLogger.jl** is a Julia package which allows you to easily log data in a table for a nice visual tabular log.
This can be used for your machine learning, optimization or any other project in which you want to have an updated line in your table every x seconds or whenever there was a significant change.
## Installation
You can install the package via the Julia package manager.
```julia
] add TableLogger
```
## Usage
First you need to define the structure of the table that you want to display.
The following will create three columns `#Open`, `#Closed` and `Time [s]`.
```julia
table = init_log_table(
(id=:open_nodes, name="#Open"),
(id=:closed_nodes, name="#Closed"),
(id=:time, name="Time [s]", width=10, alignment=:right);
width = 20,
alignment = :center
)
```
You can then print the header with:
```julia
print_header(table)
```
which will print:
```
#Open #Closed Time [s]
==================================================
```
now you can add values to the each column with `set_value!` i.e:
```julia
set_value!(table, :open_nodes, 10)
set_value!(table, :closed_nodes, 0)
set_value!(table, :time, 0.1)
```
then with `print_line(table)` a new line will be printed.
Such that together with the header your output would be:
```
#Open #Closed Time [s]
==================================================
10 0 0.1
```