Code Programing

Since you did programing a long time ago, you probably will get back in the groove pretty easy. @WobblyHand has great comments and suggestions but let me add one. I grew up on Fortran several decades ago. Then went through to several other languages which all become obsolete! Python is great and FreeCAD is based upon it, but incorporates lots of compiled C code which you never have to look at. This maybe what makes it so fast as an non compiled language. However, learning Python is a little tricky and installing it on your computer can be difficult. This is largely because it has sooo very many features (packages) for different applications that if you did and could install them all you would be at it for a long time and fill up your hard drive.

So I used MatLab for quite a while and got pretty good with it. Unfortunately, its availability is limited unless you have $$$ or access via some other employer or educational institution. Since it costs and is well supported, it is well written with lots of features and lots of explanation/help files. However, you can access it on line for about 20 hours a month for free. Learning a little MatLab first, with its help files, is a tool and will take you a long way in learning Python, where the support is based upon user groups and is there, but just not as handy and easy to use as MatLab. https://www.mathworks.com/products/matlab-online/matlab-online-versions.html . I had a complex spread sheet which I had written and wanted to do it more mathematically. I wrote it is MatLab and then again in Python and found that the Python code process was very similar to Matlab, but took more lines of code as MatLab just had more built-in functions.

When you are ready to install Python, look to Anaconda (Conda). This is a free shell (window) that will install Python pretty much automatically for you and then provide a window to using python. It makes it a little higher level programing than Python. https://www.anaconda.com/download . After it is installed you can run python outside of the shell if you want to.

Anyway, using Anaconda will make your install process for Python much easer .... as you do not have to ask the question which of all the python packages do I need to install. It is all automated for the starter ... and then later you can add more and more features if you even need them.

Anyway, maybe these steps will help you restart.

Dave L.

PS. I am thinking about rebuilding my OS one of these days... and if I do this is how I will install Python. Yes, FreeCAD uses Python so having it installed first should help ease the FreeCAD install.
As an FYI, I recommend the Scipy and Numpy libraries, as well as Matplotlib, which are accessible via Python. Together, they give you amazing computational ability rivaling and surpassing MatLab in many areas (not all). Numpy and Scipy work on arrays and matrices. They are optimized libraries, so their results are almost as fast as running it in C++, but the development time is far far less.

I was driven to learn about all this when put between a rock and a hard place at work. No budget, terrible and slow purchasing department, and an unyielding schedule. Within a year of use of Python, I basically stopped using Matlab. I've used Python/Scipy/Numpy and Pandas for scientific and engineering work for well over 15 years. I still use it now. Matplotlib generates plots just like Matlab, the beginner mode uses nearly the identical syntax as Matlab.

plot(x, y, 'b') gives you a plot of y vs x in the color blue, just like matlab.

I used all of the above recently to analyze the relative sound signatures of airguns. Read in a list of wav files, grabbed the data, did sophisticated peak finding using a scipy library, automatically time aligned and sliced the acoustic waveforms, windowed and fourier transformed the array of waveforms to look at their spectral content, and plotted all the smoothed data on a common graph. All that coding was done in a half day. Python makes it easy to code quite fast. It's a powerful tool and is free to use, whenever you want, and for as many hours as you want.

Anaconda is a good product - it makes Python easier to use and manage. Have used it before. Once I transitioned to Linux, I found that I didn't need it as much. If on Windows, Anaconda makes things a lot, lot easier.

I'm a huge Python fan. On a small memory limited platform, like a micro controller, with real time requirements, C and C++ are better suited to the task.
 
As an FYI, I recommend the Scipy and Numpy libraries, as well as Matplotlib, which are accessible via Python. Together, they give you amazing computational ability rivaling and surpassing MatLab in many areas (not all). Numpy and Scipy work on arrays and matrices. They are optimized libraries, so their results are almost as fast as running it in C++, but the development time is far far less.
If I recall correctly these libraries were part of the Anaconda/Conda install. I do not recall much about Pandas or even if I used it.

I used Matlab and National Data Acquisition Instruments (D/A and A/D) devices, to collect high resolution data. I could then run reasonably high speed FFTs, manipulate this frequency domain (special inverse filtering) and then use the inverse FFT to convert back to the time domain. It all worked pretty well. These were very large packets of data and yes, in Matlab everything is done in vector or matrix arrays. I could do the same in Python, but I found that it took few commands to do similar math large data functions in Matlab. National Instruments has now merged Matlab as well as Python into their LabView interface software so I suspect it is even easier.

Anyway, I was just proposing that for someone just starting out, or returning to code writing, that first learning Matlab is a bit easier due to the help libraries. A good practice is to write some code in Matlab then rewrite it in Python. One will quickly see the similarities as well as the differences. I did a similar thing between Excel where I had used macros and then wrote a program in Python to provide the same data. By the way, in Matlab you can easily write data to an file which Excel can read. I suspect the same ability is available in Python but I cannot recall if I did so.

Dave L
 
Pandas is used for data analytics at a large scale. I've only rarely used it, but it's really good at reading in huge spreadsheets, hdf files, and databases and digesting data. Scipy has loadmat and similar loadwav command to read in data. Python can read and write or extract data from csv files natively. Think it is called the csv library. I believe it also has the ability to deal with Excel as well, as I seem to have used it at some time in the distant past.

I have often had to translate or port from one language to the other. There's several websites showing how the two languages and their equivalent commands. I used them a lot when I got stuck.

I think Matlab is a good high level language and there's a lot of documentation available. I would recommend it for commercial use, since it is well supported, but it is far too costly for home use, with quite expensive add ons. Matlab is powerful, to be sure, but I have found that open source Python and it's libraries are seemingly equal in most cases. I had no issues doing automotive radar system simulations with 10 independent vehicles within the field of view, calculating vehicular returns and performing all the radar signal processing and target reporting. I would have done more targets, and my program allowed it, but didn't, because what I had was adequate for the purpose of behavior analysis of the radar. Based on these simulations I was able to predict real fielded behavior. Anyways, that's my limited experience with both languages over the course of nearly 20 years.

I have used National for data acquisition and analysis. It does simply some things, but I didn't find it easy to do exactly what I wanted, if I recall. Once again, a decent tool for commercial use, but not oriented towards a hobbyist or casual use.

We have wandered far afield from the original topic, it would seem. My apologies to the original poster.
 
Back
Top