-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from billy-price/module_refactor
organised the file structure better for a python module
Showing
26 changed files
with
687 additions
and
404 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
magmaenv | ||
*.cache | ||
*__pycache__ | ||
*.vscode | ||
.pytest_cache | ||
|
||
|
||
# latex | ||
*.aux | ||
*.fdb_latexmk | ||
*.fls | ||
*.log | ||
*.synctex.gz | ||
|
||
# python | ||
*__pycache__ | ||
*.pytest_cache | ||
*.pyc |
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,18 @@ | ||
TEX_TEMPLATES_PATH = 'tex_templates' | ||
from .tikz import * | ||
from .catalan import * | ||
from .asciiDrawing import * | ||
from .catalan_families.brackets import * | ||
from .catalan_families.trees import * | ||
from .catalan_families.tableaux import * | ||
from .catalan_families.dyckPaths import * | ||
from .catalan_families.productStrings import * | ||
from .catalan_families.triangulations import * | ||
from .catalan_families.mountainsAscii import * | ||
from .catalan_families.nestedMatchings import * | ||
from .catalan_families.staircasePolygons import * | ||
from .catalan_families.friezePatterns import * | ||
|
||
|
||
for Catalan_Family in Catalan.all_catalan_families(): | ||
Catalan_Family.init_norm_cache() |
File renamed without changes.
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,18 @@ | ||
class AsciiDrawing: | ||
def __init__(self, width, height): | ||
self.width = width | ||
self.height = height | ||
self.charmap = dict() | ||
|
||
def write(self, char, x, y): | ||
self.charmap[(x,y)] = char | ||
|
||
def __str__(self): | ||
return self.get_str() | ||
|
||
def get_str(self, trim_rows=False): | ||
rows = [''.join(self.charmap.get((x, self.height-y-1), ' ') for x in range(self.width)) for y in range(self.height)] | ||
if trim_rows: | ||
return '\n'.join(row for row in rows if not row.isspace()) | ||
else: | ||
return '\n'.join(rows) |
Oops, something went wrong.