ソース情報
- リポジトリ
- tomevault-io/tomes
- ソースの最終更新活動
- 2026年7月23日 21:48
- 検出された SKILL.md の言語
- 英語
- スター
- 1
- フォーク
- 0
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
メニュー
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/tomevault-io/tomes --skill keyword-testsコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
SKILL.md を表示中
SOC 職業分類に基づく
| name | keyword-tests |
| description | > Use when this capability is needed. |
| Path | Purpose |
|---|---|
tests/ | All pytest tests |
tests/testfiles/keywords/ | Reference .k files and reference_string.py |
tests/testfiles/initial/ | Initial deck .k files used as fixtures |
tests/testfiles/output/ | Expected output files for comparison |
tests/test_codegen/ | Codegen-only — do NOT run with normal pytest |
Use whichever Python environment has PyDyna installed. The commands below use
python as a placeholder — substitute your actual interpreter or prefix as needed.
Tip: Create
.github/copilot-instructions.md(already gitignored) to tell the agent which Python environment to use. For example:Use `uv run --no-project python` when running Python commands in this repo.or
Use `/path/to/my/venv/bin/python` when running Python commands in this repo.
# Run all non-run tests (standard)
python -m pytest tests/ -v
# Run a specific file
python -m pytest tests/test_keywords.py -v
# Run a specific test
python -m pytest tests/test_card.py::test_load_card_errors -v
# Run with -m run (requires LS-DYNA environment)
python -m pytest tests/ -v -m run
tests/conftest.py)| Fixture | Type | Use |
|---|---|---|
string_utils | StringUtils | Convert a string to a readable io.StringIO buffer via .as_buffer(s) |
file_utils | FileUtils | Read/compare files in testfiles/; compare output with .compare_string_with_file(output, ref_file) |
ref_string | module | Loads testfiles/keywords/reference_string.py; access expected strings as attributes |
runner | DynaRunner | Run LS-DYNA simulations; only used with @pytest.mark.run tests |
resolve_standard_path | str | Path to testfiles/standard/ |
resolve_output_path | str | Path to testfiles/output/ |
*_initialfile | str | Paths to specific initial .k files (e.g. mech_initialfile, icfd_initialfile) |
run MarkerTests that require a live LS-DYNA installation must be marked with @pytest.mark.run:
@pytest.mark.run
def test_something_that_needs_lsdyna(runner):
...
pytest tests/ without -m runpytest -m run in environments with LS-DYNA availablePattern: instantiate keyword, set fields, call .write(), compare to expected string.
from ansys.dyna.core import keywords as kwd
import pytest
def test_my_keyword_renders(file_utils):
k = kwd.MyKeyword()
k.some_field = 42
output = k.write()
file_utils.compare_string_with_file(output, "my_keyword_reference.k")
Then create tests/testfiles/keywords/my_keyword_reference.k with the expected output.
Trailing whitespace: LS-DYNA fixed-width fields are padded to their full column width, so reference
.kfiles will contain trailing spaces on data lines. Do not strip or trim whitespace in these files — doing so will cause tests to fail.
Pattern: use string_utils.as_buffer() or load a .k file via file_utils, call deck.loads() or card .read().
from ansys.dyna.core import Deck, keywords as kwd
def test_my_keyword_parses(string_utils):
input_str = "*MY_KEYWORD\n 42\n*END\n"
deck = Deck()
deck.loads(input_str)
kw = deck.get(kwd.MyKeyword)
assert kw is not None
assert kw.some_field == 42
Use Card.from_field_schemas for low-level card tests:
from ansys.dyna.core.lib.card import Card
from ansys.dyna.core.lib.field_schema import FieldSchema
def test_card_reads_correctly(string_utils):
field_schemas = (
FieldSchema("foo", int, 0, 10, None),
FieldSchema("bar", float, 10, 10, None),
)
card = Card.from_field_schemas(field_schemas)
result = card.read(string_utils.as_buffer(" 42 3.14"))
assert card.foo == 42
For tests using ref_string, add the expected value as an attribute in tests/testfiles/keywords/reference_string.py:
# In reference_string.py
test_my_keyword_output = "*MY_KEYWORD\n 42\n"
Trailing whitespace: String values in
reference_string.pymay contain trailing spaces within lines — this is intentional. LS-DYNA fixed-width fields are padded to their full column width and the output reflects that exactly. Do not strip these strings.
Then in the test:
def test_my_keyword(ref_string):
k = kwd.MyKeyword()
k.some_field = 42
assert k.write() == ref_string.test_my_keyword_output
tests/test_codegen/ — these are for the codegen validation system only, not for testing PyDyna behavior.k files and strings in reference_string.py contain trailing spaces on data lines because LS-DYNA fields are fixed-width padded. Never strip or auto-trim whitespace in these files.file_utils normalizes \r\n → \n; always use \n in reference fileswrite() output includes trailing newline — include it in reference stringsfrom ansys.dyna.core import keywords as kwd, not direct module importsformat_type.long — check with kwd.MyKeyword(format=format_type.long)Source: ansys/pydyna — distributed by TomeVault.