#-------------------------------------------------------------------------------
#  [1] MacPorts initialization:
#
#      The four packages 1) Qt5, 2) Ruby, 3) Python, and 4) libgit2 are required.
#      A typical installation flow is shown below.
#-------------------------------------------------------------------------------
   $ sudo port install coreutils
   $ sudo port install findutils
   $ sudo port install qt5
   $ sudo port install ruby33
   $ sudo port install python312
   $ sudo port install py312-pip
   $ sudo port install libgit2

   $ sudo port select --set python3 python312
   $ sudo port select --set python  python312
   $ sudo port select --set pip3    pip312
   $ sudo port select --set pip     pip312

#-------------------------------------------------------------------------------
#  [2] Installation process of different Python modules using 'pip-3.12':
#-------------------------------------------------------------------------------
MacBookPro2{kazzz-s} ~ (1)% which pip3
/opt/local/bin/pip3

MacBookPro2{kazzz-s} ~ (2)% pip3 --version
pip 24.2 from /opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip (python 3.12)

MacBookPro2{kazzz-s} ~ (3)% sudo pip3 list
:
Package    Version
---------- -------
pip        24.2
setuptools 75.1.0

MacBookPro2{kazzz-s} ~ (4)% sudo pip3 install wheel pandas scipy matplotlib
:
:
:

MacBookPro2{kazzz-s} ~ (5)% pip3 list --outdated
:
: update outdated modules if any
:

MacBookPro2{kazzz-s} ~ (6)% pip3 list
Package           Version
----------------- -----------
altgraph          0.17.4
contourpy         1.3.0
cycler            0.12.1
delocate          0.12.0
et-xmlfile        1.1.0
fonttools         4.53.1
html5lib          1.1
kiwisolver        1.4.7
klayout           0.29.6
macholib          1.16.3
Mako              1.3.5
Markdown          3.7
MarkupSafe        2.1.5
matplotlib        3.9.2
numpy             2.1.1
openpyxl          3.1.5
packaging         24.1
pandas            2.2.3
pillow            10.4.0
pip               24.2
ply               3.11
pycairo           1.27.0
PyGObject         3.50.0
pyparsing         3.1.4
python-dateutil   2.9.0.post0
pytz              2024.2
scipy             1.14.1
setuptools        75.1.0
six               1.16.0
typing_extensions 4.12.2
tzdata            2024.1
webencodings      0.5.1
wheel             0.44.0
XlsxWriter        3.2.0

#-------------------------------------------------------------------------------
#  [3] Python module import test:
#
#      Run this sample python from "Macro Development" with such a sample CSV.
#-------------------------------------------------------------------------------
'''
# Enter your Python code here
import os
import numpy as np
import scipy
import matplotlib
import pandas as pd

sampleCSV = os.environ["HOME"] + "/KLayout/sampleCSV.csv"
df = pd.read_csv( sampleCSV, comment='#' )
print(df)
'''

== Output ==
      X[mm]  Y[mm]   Ratio[]
0       0.0    3.1  1.006617
1       2.7   -1.5  1.006607
2      -2.7   -1.5  1.006321
3       0.0    9.2  1.006651
4       5.9    7.0  1.006211
...     ...    ...       ...
1805  -30.3  140.7  0.994904
1806  -24.3  141.9  0.994266
1807  -18.3  142.8  0.994888
1808  -12.2  143.4  0.994146
1809   -6.1  143.11  0.993552

[1810 rows x 3 columns]

#------------------
# End of File
#------------------
