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
// Anycubic Photon Mono X2 funnel | |
// build_x, build_y, build_z from manufacturer specs | |
build_x = 122; // mm, max X (left–right) | |
build_y = 196; // mm, max Y (front–back) | |
build_z = 200; // mm, max Z (vertical) | |
tolerance = 2; // Avoid the edges of the max build spec | |
// funnel parameters | |
wall_thickness = 6; // mm, wall thickness | |
base_dia = 25.4; // mm, spout diameter ≈1 in |
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
[profile.dev] | |
opt-level = 0 | |
debug = true | |
[profile.release] | |
opt-level = 3 | |
debug = false | |
[dependencies] | |
# Errors |
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
exclude: "docs|.git" | |
default_stages: [commit] | |
fail_fast: false | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v4.4.0 | |
hooks: | |
- id: trailing-whitespace | |
- id: end-of-file-fixer |
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
[tool.ruff.lint] | |
select = ["ALL"] | |
ignore = [ | |
"D203", # Should ignore one of D203 or D211 bc they are conflicting | |
"D213", # Should ignore one of D212 or D213 bc they are conflicting | |
"COM812", # Don't require trailing commas | |
"D205", # Don't require 1 blank line between summary and description | |
"TD002", # Don't require author for TODOs | |
"TD003", # Don't require issues for TODOs | |
"S101", # Allow asserts |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import random as rand | |
from functools import partial | |
def twiddle(run, args, p, dp, tol = 0.2, N = 100, logger = None): | |
""" Uses gradient descent to find the optimal value of p as input for function run. | |
run is a function which takes p as an argument and returns an error (with 0 being optimal) as an output. | |
dp is the initial magnitute for each index of p to begin | |
N is the max number of iterations, after which the best value of p is returned. | |
tol is the max error allowed, under which this function will terminate. """ | |
best_err, best_p, best_dp, n = 1000000, None, None, 0 |
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
""" Python 3 implementation of Deep Learning book early stop algorithm. | |
@book{Goodfellow-et-al-2016, | |
title={Deep Learning}, | |
author={Ian Goodfellow and Yoshua Bengio and Aaron Courville}, | |
publisher={MIT Press}, | |
note={\url{http://www.deeplearningbook.org}}, | |
year={2016} | |
} | |
""" |
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
import numpy as np | |
import cv2 | |
import random | |
import scipy.stats | |
# Matplotlib | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt |
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
# Ryan Peach 3/1/2016 | |
# References Used for this Implementation | |
# https://en.wikipedia.org/wiki/Hungarian_algorithm | |
# https://github.com/bmc/munkres/blob/master/munkres.py | |
# http://csclab.murraystate.edu/bob.pilgrim/445/munkres.html | |
# --- | |
# No copying and pasting of online code was performed, though some code may turn out to be similar due to the standardized nature of this algorithm. | |
# This is a very different implementation due to the fact that it heavily uses numpy, vastly simplifies many poorly pythonized coding elements | |
# removes the "class" approach for a function based one. Etc. | |
# Improvements that need to be made is to require the matrix class, and to vectorize iterations through the matrix. |
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
from time import time, sleep | |
from functools import wraps | |
import socket | |
import unittest | |
class TimeoutError(socket.timeout): | |
pass | |
none_val = lambda x: 0.0 if x is None else float(x) # Returns float(x), or 0 if x is None |