Feature Request: Read text file as a string

オープン
#42 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c
領域
backend

調査の方向性

Start by reading _list.def:338 and _convert.def:362 and :377, which the issue identifies as existing expression language functions. Check how those functions are exposed and how file paths are handled; the issue does not name a file-loading entry point or test. Done means adding a way to read a text file as a string or lines, with a clear decision about whether text belongs in nip4's expression language.

索引モデルが issue の本文から書いたものです。

説明

#enhancement

Issue
I am currently working on a colour calibration workflow and currently there is no native way to import and parse a CGATS/OQM reference lab files.
There is vips_csvload, however one can only skip a fixed number of lines, split on a delimiter (e.g. a whitespace), and convert cells to a float.

Context
When importing CGATS.17 file format, there is a large variation across files and the order of the columns. Some files contain online LAB values, others contain spectra values, and so on. They have some labels BEGIN_DATA_FORMAT, END_DATA_FORMAT, BEGIN_DATA, BEGIN_DATA.

As an example, I created a workspace to read a specific CGATS.17 formatted file, then I swapped the file with another file with 3 extra header lines which shifted my $skip count, and vips_csvload didn't error, it just silently read numbers from the wrong row. How common are such differences across CGATS.17? Very common, there is unfortunately no standardisation, out of 13 files I checked, all columns were in different orders and different header sizes.

Feature Request
Therefore in order to create a simple text parser within nip4, it would be great to have a way to convert a text file into a string, e.g. read_file : Pathname -> [char] or read_lines : Pathname -> [[char]]

I have checked the source code (_list.def:338, _convert.def:362/:377) and nip already has functions like split, parse_int, parse_float etc, so the request would be to create this file conversion rather than build a parsing framework from scratch.

Is nip4's expression language meant to stay numeric/image-only, or would it be possible to include text too?

主要言語
C
スター
106
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

libvips/nip4 のほかの issue

libvips/nip4 の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。