You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initial commit introducing MkDocs documentation, plugin implementations, test suite, CLI, and engine modules. Includes developer and user guides, API reference, test reference, example plugins, and configuration files for CI and documentation deployment. Removes obsolete LLM output file and updates core modules and tests to support new features.
Bu sayfa PatternLab paketinin programatik API'sinin kısa bir özetini sağlar. Daha geniş referans için kaynak koduna bakın: [`patternlab/engine.py`](patternlab/engine.py:1), [`patternlab/plugin_api.py`](patternlab/plugin_api.py:1), [`patternlab/cli.py`](patternlab/cli.py:1).
4
+
5
+
Önemli sınıflar ve fonksiyonlar
6
+
- Engine
7
+
- Ana analiz akışını yöneten sınıf. Kullanım: `Engine().analyze(data_bytes, config)`.
8
+
- Kaydetme: `engine.register_test(name, plugin_instance)` ve `engine.register_transform(...)`.
- Eğer ayrıntılı API referansı istenirse, `mkdocstrings` + `pytkdocs` ile otomatik döküm oluşturulabilir. Bunun için `mkdocs.yml` içinde `mkdocstrings` eklentisi ve `requirements-docs.txt` eklenmesi gerekir.
# MkDocs geliştirme sunucusu (canlı yeniden yükleme)
44
+
mkdocs serve
45
+
# yayın (GitHub Pages)
46
+
mkdocs gh-deploy
47
+
```
48
+
49
+
Daha fazla örnek konfigürasyon için bkz. [`docs/configs/example.yml`](docs/configs/example.yml:1) ve [`docs/configs/example.json`](docs/configs/example.json:1).
Bu sayfa, MkDocs yapılandırması olan [`mkdocs.yml`](mkdocs.yml:1) dosyası ile eşleşir. Bir sonraki adım olarak "Getting Started" ve "User Guide" sayfalarını zenginleştireceğim.
Bu kılavuz, hızlı bir başlangıç sağlar. İleri seviye konu veya örnek isterseniz ayrı bir doküman eklenebilir.
99
+
Bu kılavuz, hızlı bir başlangıç sağlar. İleri seviye konu veya örnek isterseniz ayrı bir doküman eklenebilir.
100
+
101
+
## Örnek: Tam Bir Test Eklentisi
102
+
103
+
Aşağıda proje içinde doğrudan kullanılabilecek minimal, test edilebilir bir TestPlugin örneği bulunmaktadır. Bu dosyayı [`patternlab/plugins/my_test.py`](patternlab/plugins/my_test.py:1) olarak ekleyebilirsiniz.
104
+
105
+
```python
106
+
# python
107
+
from patternlab.plugin_api import TestPlugin, BytesView, TestResult
108
+
109
+
classMyThresholdTest(TestPlugin):
110
+
"""Basit eşik tabanlı monobit benzeri test örneği."""
Eklentinizi doğrulamak için pytest ile basit bir test yazın. Aşağıdaki örnek dosyayı [`tests/test_my_threshold.py`](tests/test_my_threshold.py:1) olarak oluşturabilirsiniz.
130
+
131
+
```python
132
+
# python
133
+
from patternlab.plugins.my_test import MyThresholdTest
134
+
from patternlab.plugin_api import BytesView
135
+
136
+
deftest_my_threshold_pass():
137
+
plugin = MyThresholdTest()
138
+
# örnek bit dizisi: 6 bit, 5 tane 1 -> oran 0.833
139
+
data = BytesView(b'\xf8') # 11111000 (örnek)
140
+
result = plugin.run(data, {"threshold": 0.7})
141
+
assert result.passed isTrue
142
+
assert result.metrics["ones"] >=5
143
+
144
+
deftest_my_threshold_fail():
145
+
plugin = MyThresholdTest()
146
+
data = BytesView(b'\x0f') # 00001111 (oran 0.5)
147
+
result = plugin.run(data, {"threshold": 0.6})
148
+
assert result.passed isFalse
149
+
```
150
+
151
+
## Test ve CI Entegrasyonu
152
+
153
+
- Yeni eklentiyi ekledikten sonra `pytest` ile testleri çalıştırın.
154
+
- Eklentinin bağımlılıkları varsa bunları `pyproject.toml` veya `docs/requirements.txt` içine ekleyin.
155
+
- Otomatik test çalıştırma için GitHub Actions iş akışlarına test adımı ekleyin (ör: `pytest` çağrısı).
156
+
157
+
Ek referansler:
158
+
- Eklenti API detayları: [`patternlab/plugin_api.py`](patternlab/plugin_api.py:1)
159
+
- Mevcut eklenti örnekleri: [`patternlab/plugins/monobit.py`](patternlab/plugins/monobit.py:1)
0 commit comments