semvec/pypi-packages huggingface dataset:
openfoam-postprocess 0.1.2
OpenFOAM 數據處理與可視化工具
Requires Python: >=3.6

# OpenFOAM 數據處理與可視化工具

這個工具用於處理和可視化 OpenFOAM 的 `surfaceFieldValue.dat` 文件中的數據。它可以將質量分數轉換為摩爾分數，並生成各種氣體濃度和溫度的圖表。

## 功能

- 解析 OpenFOAM 的 `surfaceFieldValue.dat` 文件
- 將質量分數轉換為摩爾分數
- 生成 ASCII 圖表和摘要
- 使用 gnuplot 生成高質量圖表
- 將結果保存到 CSV 文件和 readme.txt

## 安裝

1. 確保已安裝 Python 3.6 或更高版本
2. 安裝依賴項：

```bash
pip install -r requirements.txt
```

3. 安裝 gnuplot（用於生成圖表）

## 使用方法

### 基本用法

運行主程序：

```bash
python src/main.py [surfaceFieldValue.dat 文件路徑]
```

如果未提供文件路徑，程序將嘗試在當前目錄及其子目錄中查找 `surfaceFieldValue.dat` 文件。

### 出口面監測設置

要在 OpenFOAM 中設置出口面監測，需要在 `system/controlDict` 文件中添加以下配置：

```cpp
functions
{
    outletSurfaceAvg
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");
        writeControl    writeTime;
        regionType      patch;
        name            outlet;  // 出口面的名稱
        operation       areaAverage;
        fields          (O2 CO CO2 H2O NO NO2 N2O NH3 T);
        writeFields     true;
    }
}
```

其中：
- `outlet` 是出口面的名稱，需要替換為您的實際出口面名稱
- `fields` 是要監測的場量，可以根據需要添加或刪除
- `writeControl` 控制寫入頻率，可以設置為 `timeStep`、`runTime` 或 `adjustableRunTime`
- `writeFields` 設置為 `true` 會輸出每個場量的平均值

監測數據會保存在 `postProcessing/outletSurfaceAvg/<time>/surfaceFieldValue.dat` 文件中。

## 輸出

程序將在 `gnuplot_results` 目錄中生成以下文件：

- `species_mole_fractions.csv`：包含所有物種的摩爾分數
- `O2_N2_CO2.png`：O2、N2 和 CO2 的濃度圖
- `CO_ppm.png`：CO 的濃度圖（ppm）
- `NOx_ppm.png`：NOx 的濃度圖（如果存在）
- `NH3_ppm.png`：NH3 的濃度圖（如果存在）
- `Temperature.png`：溫度圖（如果存在）
- `H2O.png`：H2O 的摩爾分數圖（如果存在）

程序還會在終端中顯示 ASCII 圖表和摘要，並將結果追加到 `readme.txt` 文件中。

## 示例

1. 設置出口面監測後，運行 OpenFOAM 模擬
2. 模擬完成後，使用本工具處理數據：

```bash
openfoam-postprocess --file postProcessing/outletSurfaceAvg/5000/surfaceFieldValue.dat
```

3. 查看生成的圖表和數據摘要
pokerpy 0.5.0
Python poker playability framework (under development)

# PokerPy under development! (Alpha)
Money logic is improved with the introduction of blind bets. The previous `last_aggressive_player` parameter has been replaced by `stopping_player`. The key difference is that in earlier versions, the last aggressive player ended the betting round BEFORE playing, whereas now the stopping player ends the round AFTER taking action. This change helps clarify who acts first after blinds are posted, while still supporting betting rounds without blinds (flop, turn and river). Additionally, this version introduces a configurable minimum bet amount, along with a minimum raise amount equal to the size of the previous bet or raise.

### 0.5.0
- All features are developed to reach the goal.
- Started from version *0.4.1*.

## Upcoming versions
- **0.6 (alpha):** Stack sizes will be finite for the first time. This change introduces support for all-in scenarios and the creation of side pots. At this point, users will be able to implement realistic betting rounds.
- **0.7 (beta):** A fully functional framework for No Limit Texas Hold'em cash games will be introduced. This includes game dynamics such as button movement logic, support for players entering and leaving the table, and proper handling of heads-up situations.
- **1.0 (stable):** The first stable release. No major features are planned beyond this point, though minor adjustments or enhancements may arise from final testing and feedback.
token-cli 0.1.0
A command-line tool to visualize tokenized text.
Requires Python: >=3.9

<h1 align="center">Token CLI</h1>

<p align="center">A command-line tool to visualize tokenized text using different encodings.</p>

![Demo](demo.gif)

## Installation

1.  Clone this repository:
    ```bash
    git clone https://github.com/taha-yassine/token-cli.git
    cd token-cli
    ```
2.  Install dependencies (preferably in a virtual environment):
    ```bash
    # Using pip
    python -m venv .venv
    source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
    pip install -r requirements.txt

    # Or using uv
    uv venv
    uv pip install -r requirements.txt
    ```

## Usage

```bash
python main.py [OPTIONS] [INPUT_FILE]
```

**From standard input:**

```bash
echo "This is sample text." | python main.py --hide-stats
```

**From a file:**

```bash
python main.py --tokenizer gpt-4 your_text_file.txt
```

**Interactive Preview:**

Use the `-p` or `--preview-files` flag to launch an interactive `fzf` session. This allows you to browse files in the current directory and its subdirectories, showing a live preview of the tokenization.

```bash
python main.py -p
# Or with a specific tokenizer/mode for the previews
python main.py --tokenizer cl100k_base --mode text -p
```

## Options

```
usage: main.py [-h] [--tokenizer TOKENIZER] [--mode {text,highlight}]
               [--hide-text] [--hide-stats] [--force-terminal] [-p]
               [input_file]

Visualize tokenized text.

positional arguments:
  input_file            Path to the input text file. Reads from stdin if not
                        provided.

options:
  -h, --help            show this help message and exit
  --tokenizer TOKENIZER
                        Tokenizer to use for tokenization. Possible values:
                        gpt-4o, o200k_base, cl100k_base, p50k_base, p50k_edit,
                        r50k_base, gpt2 (default: o200k_base)
  --mode {text,highlight}
                        Mode for displaying tokens: 'text' or 'highlight'.
                        (default: highlight)
  --hide-text           Hide the tokenized text.
  --hide-stats          Hide the token and character counts at the end.
  --force-terminal      Force terminal output.
  -p, --preview-files   Use fzf to preview tokenization of files in the
                        current directory.
```