Unit 7.1 - Rust from Python
Exercise 7.1.1: Test your environment
Check it is working:
cd rust-dna
uv run maturin develop --uv
cd ..
uv run pytest
The output should look something like this:
❯ uv run pytest
Installed 5 packages in 9ms
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/tamme/dev/rust-training/exercises/7-rust-for-data-science/1-rust-from-python
configfile: pyproject.toml
collected 10 items
test_decoding.py .... [ 40%]
test_kmers.py .... [ 80%]
test_setup.py . [ 90%]
test_validation.py . [100%]
============================== 10 passed in 0.06s ==============================
Exercise 7.1.2: Translating Python to rust
Open exercises/7-rust-for-data-science/1-rust-from-python/ in your editor and follow the steps in main.py to translate the logic to Rust in rust-dna/lib.rs.