-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add api function for partial tip configurations
- Loading branch information
1 parent
695b4b4
commit 7353369
Showing
10 changed files
with
251 additions
and
1 deletion.
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,47 @@ | ||
import re | ||
from dataclasses import dataclass | ||
|
||
# TODO MEOW THIS STRING TYPE TO SHARED PLACE | ||
ACCEPTABLE_NOZZLE_KEY_RE = re.compile("[A-Z][0-100]") | ||
|
||
|
||
@dataclass | ||
class NozzleLayoutBase: | ||
primary_nozzle: str | ||
|
||
def __post_init__(self): | ||
if not ACCEPTABLE_NOZZLE_KEY_RE.match(self.primary_nozzle): | ||
raise ValueError( | ||
f"{self.primary_nozzle} does not fit the standard nozzle naming convention. Please ensure the nozzle is labled <LETTER><NUMBER> and that your letter is capitalized." | ||
) | ||
|
||
|
||
@dataclass | ||
class SingleNozzleLayout(NozzleLayoutBase): | ||
pass | ||
|
||
|
||
@dataclass | ||
class RowNozzleLayout(NozzleLayoutBase): | ||
pass | ||
|
||
|
||
@dataclass | ||
class ColumnNozzleLayout(NozzleLayoutBase): | ||
pass | ||
|
||
|
||
@dataclass | ||
class QuadrantNozzleLayout(NozzleLayoutBase): | ||
back_left_nozzle: str | ||
front_right_nozzle: str | ||
|
||
def __post_init__(self): | ||
if not ACCEPTABLE_NOZZLE_KEY_RE.match(self.back_left_nozzle): | ||
raise ValueError( | ||
f"{self.back_left_nozzle} does not fit the standard nozzle naming convention. Please ensure the nozzle is labled <LETTER><NUMBER> and that your letter is capitalized." | ||
) | ||
if not ACCEPTABLE_NOZZLE_KEY_RE.match(self.front_right_nozzle): | ||
raise ValueError( | ||
f"{self.front_right_nozzle} does not fit the standard nozzle naming convention. Please ensure the nozzle is labled <LETTER><NUMBER> and that your letter is capitalized." | ||
) |
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
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
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