Skip to content

πŸ“¦ Equation/Data Format in Markdown File

Choose a tag to compare

@sinagilassi sinagilassi released this 17 May 22:59
· 1611 commits to main since this release

✨ New Feature: Load Equations and Data from Markdown Files

We are excited to introduce support for structured thermodynamic data and equations using Markdown (.md) files! This new capability allows users to manage and reference tabulated data and equation sets in a human-readable format.

🧩 Markdown Pattern Format

The accepted markdown file must follow a specific structure. A typical reference file includes:

# REFERENCES

## content

DATABOOK-ID: content

### table-name-1

TABLE-ID: content
DESCRIPTION: content
DATA: []

MATRIX-SYMBOL:
  - a
  - b
  - c
  - alpha

EQUATIONS:
- EQ-1:
  - BODY:
      - content
      - content
  - BODY-INTEGRAL:
      - content
      - content
  - BODY-FIRST-DERIVATIVE:
      - content
      - content
  - BODY-SECOND-DERIVATIVE:
      - content
      - content

STRUCTURE:
- COLUMNS: [item1, item2]
- SYMBOL: [item1, item2]
- UNIT: [item1, item2]
- CONVERSION: [item1, item2]

VALUES:
- [item1, item2]
- [item1, item2]

EXTERNAL-REFERENCES:
- url1
- url2

πŸ› οΈ How to Use in Code

Here's how to integrate your custom markdown reference in the app:

import os
import pyThermoDB as ptdb

# File path
md_file = 'str-ref-1.md'
md_path = os.path.join(parent_dir, md_file)

# Register reference
ref = {'reference': [md_path]}

# Initialize your ThermoDB with the custom markdown reference
thermo_db = ptdb.init(custom_reference=ref)

# Optional: print loaded references
# print(thermo_db.reference)

# Select your reference for use
print(thermo_db.select_reference('CUSTOM-REF-1'))

πŸ“š Benefits

  • πŸ“„ Readable & Editable: Use plain-text .md files for maintaining your thermodynamic databases.
  • πŸ” Reusable: Define equations and structures once, reuse across tables.
  • πŸ”— Extensible: Easily include external references and structured equations.