-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sweater swatching functions/docs, bump version
- Loading branch information
Showing
6 changed files
with
236 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"id": "79c68bfb-df11-41d8-903c-595e35e89dd3", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"49.191489361702125" | ||
] | ||
}, | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"import pyknit\n", | ||
"\n", | ||
"# Sweater fit check math. My gauge doesn't match the pattern but I like the fabric I got in my swatch and don't want to\n", | ||
"# change the needle I'm using. What size should I knit?\n", | ||
"\n", | ||
"pattern_g = pyknit.GaugeSwatch(stitch_count = 27.5, stitch_measure = 4, row_count = 40, row_measure = 4, units = \"in\") \n", | ||
"my_g = pyknit.GaugeSwatch(stitch_count = 23.5, stitch_measure = 4, row_count = 33, row_measure = 4, units = \"in\") \n", | ||
"\n", | ||
"# The closest size to my measurements is the 42in chest one, let's convert that\n", | ||
"\n", | ||
"pyknit.convert_stitch_measure(42, pattern_g, my_g)\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"id": "e148ad75-18ee-43e2-9b67-4bf073eea761", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"44.42553191489362" | ||
] | ||
}, | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"# Okay, that's going to be rather big... what about the next size down?\n", | ||
"\n", | ||
"pyknit.convert_stitch_measure(38, pattern_g, my_g)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"id": "829b714d-9dca-4440-abb7-e71a48475238", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"39.829787234042556" | ||
] | ||
}, | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"# closer...\n", | ||
"\n", | ||
"pyknit.convert_stitch_measure(34, pattern_g, my_g)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 11, | ||
"id": "eba5a902-4585-410d-9391-b6f33964164b", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# So if my chest measurement was exactly 42, I could either knit the 40in one and have -2 ease \n", | ||
"# (i.e. the sweater will stretch over my chest) or 44 and have +2 ease (i.e. it'll be a bit loose)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "081deaa3-5aba-44fe-8583-89dcc1899fd6", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pyknit | ||
|
||
# Sweater fit check math. My gauge doesn't match the pattern but I like the | ||
# fabric I got in my swatch and don't want to change the needle I'm using. | ||
# What size should I knit? | ||
|
||
pattern_g = pyknit.GaugeSwatch( | ||
stitch_count=27.5, stitch_measure=10, row_count=40, row_measure=4, units="in" | ||
) | ||
my_g = pyknit.GaugeSwatch( | ||
stitch_count=23.5, stitch_measure=10, row_count=33, row_measure=4, units="in" | ||
) | ||
|
||
# The closest size to my measurements is the 42in chest one, let's convert that | ||
|
||
size3 = pyknit.convert_stitch_measure(42, pattern_g, my_g) | ||
print(f"{size3=}") | ||
|
||
size2 = pyknit.convert_stitch_measure(38, pattern_g, my_g) | ||
size1 = pyknit.convert_stitch_measure(34, pattern_g, my_g) | ||
print(f"{size2=}") | ||
print(f"{size1=}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters