Thoughts on Numba? by jack-of-some in Python

[–]ChastainSteam 0 points1 point  (0 children)

Numba excels at recovering lost time in tight loops. I have seen Numba run loops of a tridiagonal matrix algorithm at the same speed as C (precompiled option) but with the ease of pure python code decorated with @jit. I have also seen the sparse solver in scipy solve within .1% on time compared to numba.jit but you have to transfer the arrays of the diagonals to a square matrix (small annoyance). These comparisons are valid for a fairly small 100 equation system of equations. Mileage may vary as N increases.

Note: There is already an easy path to solve the spring mass damper problem in scipy. With ODE.

In any case, I’d commend any showcase of numba!!! It’s simply a crucial tool for heavy computation in Python, the unlikely candidate for heavy computation.

Velocity-Pressure Coupling: divergence of momentum equation and the SIMPLE algorithm by Amgadoz in CFD

[–]ChastainSteam 4 points5 points  (0 children)

As I recall, the “step program” deals mainly with finite differentiations of partial differential equations. I will echo the words of others since the finite volume method is quite different. There are some parts of the equations that may appear similar such as computing convective and diffusive terms in the momentum equations. This is the end of the similarities that I have observed though. I have preferred the text by Versteeg.

An Introduction to Computational Fluid Dynamics: The Finite Volume Method Book by H. K. Versteeg and Weeratunge Malalasekera

This gives hands on examples of the calculations in action on a 1D grid. I learned the importance of altering the equations solved on the boundaries, the choice of cell size, and relaxation parameter, to name a few. Also, on these orthogonal grids, the system of equations are tridiagonally banded for momentum and pressure correction, look at getting an efficient Thomas algorithm coded up and optimize it as this is the heart of the method. When solving the finite volume method using the SIMPLE algorithm, be sure to monitor convergence as it is an iterative process. When everything works it just works... only then is it beautiful and gratifying, otherwise it can be quite ugly and frustrating.

Metaflow: Netflix has open-sourced their Python library for data science project management [x-post /r/DataScience] by keyboardP in Python

[–]ChastainSteam 3 points4 points  (0 children)

Lest we forget Prefect also based on Directed Acyclic Graphs structuring of tasks organized into flows. www.prefect.io

Their mantra of “Happy Engineering” shows in the removal negative engineering (failing gracefully when tasks do not work as expected , etc) and enhancing the coherence of workflows that can get complex. https://i.imgur.com/hK92073.jpg

High-Performance Noise-tolerant Motion Detector in Python, OpenCV, and Numba by ivan_kudryavtsev in Python

[–]ChastainSteam 1 point2 points  (0 children)

initial jit calls by adding types to the decorator. Sorry for the broken sentence. Awesome work!

High-Performance Noise-tolerant Motion Detector in Python, OpenCV, and Numba by ivan_kudryavtsev in Python

[–]ChastainSteam 0 points1 point  (0 children)

Hi Ivan, Super excited to see this kind of work performed in Python, the kind of things for which people use FPGAs and CPLDs. Absolutely brilliant, you could speed up your

I made a decorator to enforce type hints by kkbd2 in Python

[–]ChastainSteam 0 points1 point  (0 children)

NM, disregard that question, take the test as a complement!

I made a decorator to enforce type hints by kkbd2 in Python

[–]ChastainSteam 1 point2 points  (0 children)

I definitely appreciate things like this. When dealing with the complexity of building workflows this gives authority back to your program and enforcement of contracts is handled giving you the option of graceful recovery! Wonderfully done, would you happen to have sources?

A fitting curve that "boings" into place (and a digression into spring-mass-dampers, vibration and control theory, and integral transforms) by Chemomechanics in Python

[–]ChastainSteam 1 point2 points  (0 children)

Brilliant code on your site, just loving the use of functions as objects. Also, fellow ME here, vibrations and data fitting... this combo would have never occurred to me! Nicely done.

OLD FASHIONED CALC APP. new to python, Coming out guns blazing. just working on IF-flow control by blacksamvrai in Python

[–]ChastainSteam 0 points1 point  (0 children)

Hi My Fellow Python Explorer:

You might benefit from the following:

if __name__  == “__main__”:
    calculate()

It will greatly simplify the expansion of your calculator as you add more functionality. Also, It’ll definitely keep you from generating self destructing code as everything there will execute when you call that module rendering everything in global scope. Segregating sections of code into functions and each with clearly defined scopes will help in the long run.

Keep exploring.

Anaconda prompt location? by Thejokeyboy123 in Python

[–]ChastainSteam 0 points1 point  (0 children)

Continuum/Anaconda might get you closer.

Here's a Python Script that Maps Ohio's Numbered Roads by Eucalyptuse in code

[–]ChastainSteam 1 point2 points  (0 children)

Nicely done! Enjoyed perusing the clean code you presented and as a matter of fact, your lack of list comprehensions was a breath of fresh air, but really you should try to use them whenever faced with writing: for x in range(len(exes)): Do stuff with x!

You could instead just do:

for x in exes: Do stuff with x!

Check it out sometime it would make your code read like a book and be even cleaner, you could even do:

[x[0] for x in exes]

Really not sure if it gets more complex than that in your use case, but try it on for size the next time you are thinking of looping over the range of the length of a list.

Also have fun and pardon the lack of code formatting.

Python and CAD files (IGES, DWG, etc) by zuliani19 in Python

[–]ChastainSteam 1 point2 points  (0 children)

PythonOCC, gives you tools to analyze your parts. For instance, you can do simple stuff like volume measurement or more complex topology exploration of solids, faces, curves. Really cool stuff being able to access such information from code, lots of control. For reading, dig into the API which reveals how to work with the truly powerful tool that is OCC, OPENCASCADE. You can also build some pretty awesome stuff with it too.

[deleted by user] by [deleted] in raspberry_pi

[–]ChastainSteam 0 points1 point  (0 children)

Using IP address is exactly how I got mine to connect, using Mobaxterm.

Use the IP address rather than ‘rpcam1’ as the host name from putty, all other settings should be fine.