Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making it easier to test alternate grid configurations + 5x5px tile set #25

Merged
merged 18 commits into from
Jun 6, 2023

Conversation

sz3
Copy link
Owner

@sz3 sz3 commented Jun 6, 2023

This mostly involves requiring params (where they assumed magical constants), and creating a new conf.py file that encapsulates the various config parameters.

Three example configurations are included:

Anyway, it is now be easier to test/validate various alternate config sizes.

@@ -7,7 +7,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.6, 3.7, 3.8, pypy3]
python-version: [3.7, 3.8, 3.9, "3.10"]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditching 3.6 and pypy3 -- really, we could ditch more of these.

def _fountain_chunk_size(ecc=ECC, bits_per_op=bits_per_op(), fountain_blocks=FOUNTAIN_BLOCKS):
return int((155-ecc) * bits_per_op * 10 / fountain_blocks)
def num_cells():
return conf.CELL_DIM_Y*conf.CELL_DIM_X - (conf.MARKER_SIZE_X*conf.MARKER_SIZE_Y * 4)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grid is still square (for now?) but the number of cells might not be (in the case where we forgo padding in one dimension).

CELL_DIM_X = 112
CELLS_OFFSET = 8
ECC = 30
ECC_BLOCK_SIZE = 155
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8x8

CELL_SPACING_Y = CELL_SPACING_X
INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE
MARKER_SIZE_X = round(54 / CELL_SPACING_X)
MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boilerplate...

for k,v in cls.__dict__.items():
if k.startswith('_'):
continue
setattr(this, k, v)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is some magic to inject the config params into the conf. namespace. I'm not sure if this is the best way to do it, but it's fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant