Skip to main content

Python tools to support scientific computing experiments.

Project description

SEKit (science experiment kit, エスイーキット)

科学計算実験のために、作者が自分で使うように作成したPythonツール郡です。 それぞれ独立して使用することができますが、親和性が高いので連携して使うことがおすすめです。

現在は以下のツールを提供しています。 各ツールの使い方は、それぞれのツールが保存されているディレクトリのREADMEを参照してください。

  • Spartan
    • クラスタマシン用分散実行ツール。ローカルマシンだけでも使えます。
    • ドキュメント: docs/spartan.md
  • EIO
    • 実験用関数をいい感じに保存するためのデコレータ
    • ドキュメント: docs/eio.md
  • Search
    • 実験結果が保存されたJSONファイルを集約して、CSV形式に変換するツール
    • ドキュメント: docs/search.md
  • Stats
    • Searchの拡張ツール. Searchの結果から統計値を算出するツール
    • ドキュメント: docs/stats.md
  • jymatplot
    • JSONかYAMLからグラフ画像を描画するmatplotlibのラッパー
    • ドキュメント: docs/jymatplot.md

インストール方法

以下の pip install でインストールできます。

pip install sekit

【開発者向け】注意

開発環境のセットアップ (uv)

依存パッケージの管理には uv を使用します。以下を実行してください。

uv sync --dev

テストのセットアップ

以下は 結合テスト (pytest -m integration) を実行するためのセットアップ です。 単体テスト (uv run pytest) のみであれば、このセットアップは不要です。

結合テストを実行する場合は、以下の手順を実行してください。 以下の手順のコマンドはすべて本リポジトリのルートディレクトリで実行されるものとします。

  1. 例えば以下のコマンドで、SSH接続用の秘密鍵と公開鍵を作る
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

この時、~/.ssh/にid_rsaとid_rsa.pubができる。

  1. 以下のコマンドを実行して、このファイルがあるディレクトリにid_rsa.pubを保存する。
cp ~/.ssh/id_rsa.pub ./tests/spartan/
  1. 以下のコマンドを実行して、Dockerイメージをビルドする
docker build -t test_ssh_server ./tests/spartan/
  1. 以下のコマンドを実行して、テスト用Dockerコンテナを起動する。
docker run -d -p 2222:22 --name test_ssh_container test_ssh_server
  1. /etc/hostsを設定してtest-ssh-serverというホスト名で127.0.0.1につながるようにする。
127.0.0.1       test-ssh-server
  1. ~/.ssh/configに以下の設定を追加する。
Host test-ssh-server
  HostName test-ssh-server
  User root
  Port 2222

確認方法

ssh test-ssh-server

テストの実行方法

テストコードは pytest で実装されています。マーカーで単体テストと結合テストを分けています。

  • 単体テスト(デフォルト)
uv run pytest
  • 結合テスト(SSH/Docker のセットアップが必要)
uv run pytest -m integration

commit時の自動チェック (pre-commit)

git commit 時に ruff format / ruff check --fix / mypy --strict / pytest (unit) を自動実行するには、以下を一度実行してください。

uv run pre-commit install

作者情報

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sekit-1.0.2.tar.gz (136.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sekit-1.0.2-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file sekit-1.0.2.tar.gz.

File metadata

  • Download URL: sekit-1.0.2.tar.gz
  • Upload date:
  • Size: 136.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sekit-1.0.2.tar.gz
Algorithm Hash digest
SHA256 16b64c05bf932dd909541c01df6de67a3c43be5a69670163f9d48dfc82cb92cc
MD5 30119e3a8df73a849dd5be3173b27da6
BLAKE2b-256 c2e5a3b013d534748ed924d6ac135ed96363e8aa87be4b98da8178ddf22273cb

See more details on using hashes here.

File details

Details for the file sekit-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: sekit-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sekit-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 09ffed3bbca60080ccd9d8a2109baa7f3f2034aaa1720435198d3c56c7959f22
MD5 9bcc93b31d5248890d4b878ff8da000f
BLAKE2b-256 51dfa81d51d34cac5aea660a8b62dd86732ecafd7f9f0317aaddf1d0d51cbb79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page