Cyclic crop rotations labeling for crop sequences
Project description
Cyclic Crop Rotation
Description
This package implements a method to calculate crop rotation labels from any given sequence.
Installation
pip install cyclic-crop-rotation
Simple usage
See example folder for more complex use cases.
from cyclic_crop_rotation import *
# Crop Sequence
seq = (1, 5, 1, 5, 5, 1, 5, 1)
# Valid words
words = get_valid_words(seq,repeat=False,max_syl=3)
# Select out of the valid words the ones to use
gr = post_selection(greedy_set_cover(words))
fo = post_selection(first_observed_cover(words))
lr = post_selection(longest_repetition_cover(words))
# Get rotation tokens
gr_tok = word2token(seq,gr)
fo_tok = word2token(seq,fo)
lr_tok = word2token(seq,lr)
print(seq)
# Print reordered tokens
print(f'Greedy:{[token2standardtoken(i) for i in gr_tok]}')
print(f'1st Obs:{[token2standardtoken(i) for i in fo_tok]}')
print(f'Long Rep:{[token2standardtoken(i) for i in lr_tok]}')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cyclic_crop_rotation-2025.0.0.tar.gz.
File metadata
- Download URL: cyclic_crop_rotation-2025.0.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44aaa82dde620c121294251643ea7e9218a9d277f2e5096c809236a30d77ceb6
|
|
| MD5 |
f2b31c7fa2c25d1e7d796aa428d84693
|
|
| BLAKE2b-256 |
fb5309a304538e519bf5c9f43cf56d7bc74e51de465997780094949b3c8808d4
|
File details
Details for the file cyclic_crop_rotation-2025.0.0-py3-none-any.whl.
File metadata
- Download URL: cyclic_crop_rotation-2025.0.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c454740b7c81aadf3c98a939b6e2338f03f21ac0acc64a4eb80bea05b16a2d8
|
|
| MD5 |
9283347935dabc65289f5b2b9d74ca20
|
|
| BLAKE2b-256 |
eb15572a2b3076a66b78b0c9400caa5caa16ba9741d2f2ee8117336e95454b89
|