PyGamLab 1.7.8__tar.gz → 1.9.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. {pygamlab-1.7.8 → pygamlab-1.9.8}/PKG-INFO +1 -1
  2. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/Constants.py +0 -48
  3. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/Converters.py +0 -52
  4. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/Data_Analysis.py +7 -54
  5. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/Functions.py +0 -47
  6. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/__init__.py +1 -1
  7. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_ai.py +174 -173
  8. pygamlab-1.9.8/PyGamLab/structures/__init__.py +29 -0
  9. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab.egg-info/PKG-INFO +1 -1
  10. {pygamlab-1.7.8 → pygamlab-1.9.8}/pyproject.toml +1 -1
  11. {pygamlab-1.7.8 → pygamlab-1.9.8}/setup.py +1 -1
  12. pygamlab-1.7.8/PyGamLab/structures/__init__.py +0 -33
  13. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/__init__.py +0 -0
  14. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-decision-tree-pipe.gam_ai +0 -0
  15. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-decision-tree.gam_ai +0 -0
  16. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-knn-pipe.gam_ai +0 -0
  17. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-knn.gam_ai +0 -0
  18. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-linear-regression-pipe.gam_ai +0 -0
  19. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-linear-regression.gam_ai +0 -0
  20. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-mlp-pipe.gam_ai +0 -0
  21. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-mlp.gam_ai +0 -0
  22. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-random-forest-pipe.gam_ai +0 -0
  23. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-random-forest.gam_ai +0 -0
  24. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-svr-pipe.gam_ai +0 -0
  25. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-armchair-svr.gam_ai +0 -0
  26. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-dt-pipe.gam_ai +0 -0
  27. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-dt.gam_ai +0 -0
  28. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-knn-pipe.gam_ai +0 -0
  29. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-knn.gam_ai +0 -0
  30. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-linear-regression-pipe.gam_ai +0 -0
  31. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-linear-regression.gam_ai +0 -0
  32. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-mlp-pipe.gam_ai +0 -0
  33. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-mlp.gam_ai +0 -0
  34. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-rf-pipe.gam_ai +0 -0
  35. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-rf.gam_ai +0 -0
  36. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-svr-pipe.gam_ai +0 -0
  37. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-cte-svr.gam_ai +0 -0
  38. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-decision-tree-pipe.gam_ai +0 -0
  39. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-decision-tree.gam_ai +0 -0
  40. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-knn-pipe.gam_ai +0 -0
  41. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-knn.gam_ai +0 -0
  42. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-linear-regression-pipe.gam_ai +0 -0
  43. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-linear-regression.gam_ai +0 -0
  44. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-mlp-pipe.gam_ai +0 -0
  45. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-mlp.gam_ai +0 -0
  46. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-random-forest-pipe.gam_ai +0 -0
  47. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-random-forest.gam_ai +0 -0
  48. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-svr-pipe.gam_ai +0 -0
  49. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/Graphene-zigzag-svr.gam_ai +0 -0
  50. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/__init__.py +0 -0
  51. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-dt.gam_ai +0 -0
  52. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-knn.gam_ai +0 -0
  53. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-lr.gam_ai +0 -0
  54. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-mlp.gam_ai +0 -0
  55. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-pipe-dt.gam_ai +0 -0
  56. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-pipe-knn.gam_ai +0 -0
  57. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-pipe-lr.gam_ai +0 -0
  58. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-pipe-mlp.gam_ai +0 -0
  59. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-pipe-rf.gam_ai +0 -0
  60. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-pipe-svr.gam_ai +0 -0
  61. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-rf.gam_ai +0 -0
  62. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-cte-svr.gam_ai +0 -0
  63. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-dt.gam_ai +0 -0
  64. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-knn.gam_ai +0 -0
  65. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-lr.gam_ai +0 -0
  66. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-mlp.gam_ai +0 -0
  67. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-pipe-dt.gam_ai +0 -0
  68. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-pipe-knn.gam_ai +0 -0
  69. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-pipe-lr.gam_ai +0 -0
  70. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-pipe-mlp.gam_ai +0 -0
  71. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-pipe-rf.gam_ai +0 -0
  72. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-pipe-svr.gam_ai +0 -0
  73. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-rf.gam_ai +0 -0
  74. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-poisson-ratio-svr.gam_ai +0 -0
  75. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-dt.gam_ai +0 -0
  76. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-knn.gam_ai +0 -0
  77. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-lr.gam_ai +0 -0
  78. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-mlp.gam_ai +0 -0
  79. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-pipe-dt.gam_ai +0 -0
  80. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-pipe-knn.gam_ai +0 -0
  81. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-pipe-lr.gam_ai +0 -0
  82. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-pipe-mlp.gam_ai +0 -0
  83. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-pipe-rf.gam_ai +0 -0
  84. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-pipe-svr.gam_ai +0 -0
  85. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-rf.gam_ai +0 -0
  86. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-porosity-svr.gam_ai +0 -0
  87. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-dt.gam_ai +0 -0
  88. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-knn.gam_ai +0 -0
  89. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-lr.gam_ai +0 -0
  90. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-mlp.gam_ai +0 -0
  91. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-pipe-dt.gam_ai +0 -0
  92. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-pipe-knn.gam_ai +0 -0
  93. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-pipe-lr.gam_ai +0 -0
  94. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-pipe-mlp.gam_ai +0 -0
  95. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-pipe-rf.gam_ai +0 -0
  96. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-pipe-svr.gam_ai +0 -0
  97. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-rf.gam_ai +0 -0
  98. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/cu-nanocomposites-young-modulus-svr.gam_ai +0 -0
  99. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-dt.gam_ai +0 -0
  100. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-knn.gam_ai +0 -0
  101. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-lr.gam_ai +0 -0
  102. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-mlp.gam_ai +0 -0
  103. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-pipe-dt.gam_ai +0 -0
  104. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-pipe-knn.gam_ai +0 -0
  105. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-pipe-lr.gam_ai +0 -0
  106. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-pipe-mlp.gam_ai +0 -0
  107. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-pipe-rf.gam_ai +0 -0
  108. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-pipe-svc.gam_ai +0 -0
  109. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-rf.gam_ai +0 -0
  110. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/mos2-monolayer-type-svc.gam_ai +0 -0
  111. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-decision-tree-pipe.gam_ai +0 -0
  112. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-decision-tree.gam_ai +0 -0
  113. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-knn-pipe.gam_ai +0 -0
  114. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-knn.gam_ai +0 -0
  115. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-linear-regression-pipe.gam_ai +0 -0
  116. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-linear-regression.gam_ai +0 -0
  117. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-mlp-pipe.gam_ai +0 -0
  118. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-mlp.gam_ai +0 -0
  119. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-random-forest-pipe.gam_ai +0 -0
  120. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-random-forest.gam_ai +0 -0
  121. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-svr-pipe.gam_ai +0 -0
  122. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/percent-symmetry-svr.gam_ai +0 -0
  123. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-dt-pipe.gam_ai +0 -0
  124. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-dt.gam_ai +0 -0
  125. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-knn-pipe.gam_ai +0 -0
  126. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-knn.gam_ai +0 -0
  127. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-linear-regression-pipe.gam_ai +0 -0
  128. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-linear-regression.gam_ai +0 -0
  129. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-mlp-pipe.gam_ai +0 -0
  130. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-mlp.gam_ai +0 -0
  131. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-rf-pipe.gam_ai +0 -0
  132. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-rf.gam_ai +0 -0
  133. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-svr-pipe.gam_ai +0 -0
  134. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/persurface-svr.gam_ai +0 -0
  135. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-dt-pipe.gam_ai +0 -0
  136. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-dt.gam_ai +0 -0
  137. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-knn-pipe.gam_ai +0 -0
  138. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-knn.gam_ai +0 -0
  139. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-linear-regression-pipe.gam_ai +0 -0
  140. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-linear-regression.gam_ai +0 -0
  141. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-mlp-pipe.gam_ai +0 -0
  142. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-mlp.gam_ai +0 -0
  143. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-rf-pipe.gam_ai +0 -0
  144. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-rf.gam_ai +0 -0
  145. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-svr-pipe.gam_ai +0 -0
  146. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/pertma-svr.gam_ai +0 -0
  147. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-decision-tree-pipe.gam_ai +0 -0
  148. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-decision-tree.gam_ai +0 -0
  149. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-knn-pipe.gam_ai +0 -0
  150. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-knn.gam_ai +0 -0
  151. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-linear-regression-pipe.gam_ai +0 -0
  152. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-linear-regression.gam_ai +0 -0
  153. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-mlp-pipe.gam_ai +0 -0
  154. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-mlp.gam_ai +0 -0
  155. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-random-forest-pipe.gam_ai +0 -0
  156. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-random-forest.gam_ai +0 -0
  157. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-svr-pipe.gam_ai +0 -0
  158. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/ai_core/gam_models/phosphorene-svr.gam_ai +0 -0
  159. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/databases/Aflow.py +0 -0
  160. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/databases/COD.py +0 -0
  161. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/databases/Jarvis.py +0 -0
  162. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/databases/Main_DB.py +0 -0
  163. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/databases/Material_projects.py +0 -0
  164. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/databases/__init__.py +0 -0
  165. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/GAM_architectures/GAM_Graphene.py +0 -0
  166. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/GAM_architectures/GAM_nano_particles.py +0 -0
  167. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/GAM_architectures/GAM_nanotubes.py +0 -0
  168. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/GAM_architectures/GAM_phosphorene.py +0 -0
  169. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/GAM_architectures/GAM_sillicene.py +0 -0
  170. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/GAM_architectures/__init__.py +0 -0
  171. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/Generators/__init__.py +0 -0
  172. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/Generators/auto_bulk.py +0 -0
  173. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/Generators/one_d.py +0 -0
  174. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/Generators/two_d.py +0 -0
  175. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/Generators/zero_d.py +0 -0
  176. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/Primatom/__init__.py +0 -0
  177. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/Primatom/gam_molecule.py +0 -0
  178. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/Primatom/gam_universe.py +0 -0
  179. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/gamvis/__init__.py +0 -0
  180. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/gamvis/gamvis.py +0 -0
  181. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/gamvis/gamvis_engine.py +0 -0
  182. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/io/__init__.py +0 -0
  183. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/io/checker.py +0 -0
  184. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/io/conversions.py +0 -0
  185. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/io/export.py +0 -0
  186. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab/structures/io/read.py +0 -0
  187. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab.egg-info/SOURCES.txt +0 -0
  188. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab.egg-info/dependency_links.txt +0 -0
  189. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab.egg-info/requires.txt +0 -0
  190. {pygamlab-1.7.8 → pygamlab-1.9.8}/PyGamLab.egg-info/top_level.txt +0 -0
  191. {pygamlab-1.7.8 → pygamlab-1.9.8}/README.md +0 -0
  192. {pygamlab-1.7.8 → pygamlab-1.9.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyGamLab
3
- Version: 1.7.8
3
+ Version: 1.9.8
4
4
  Summary: A scientific Python library with constants, unit convertors, formulas, and data analysis tools.
5
5
  Home-page: https://github.com/APMaii/pygamlab/tree/main
6
6
  Author: Ali Pilehvar Meibody
@@ -1,51 +1,3 @@
1
- '''
2
- Constants.py ==>
3
-
4
-
5
- This module contains scientific constants intended for use throughout the package.
6
- '''
7
-
8
- #" IN GOD WE TRUST, ALL OTHERS MUST BRING DATA"
9
- # -W. Edwards Deming
10
- #------------------------------------------------------------------------------
11
- # Copyright 2023 The Gamlab Authors. All Rights Reserved.
12
- # Licensed under the Apache License, Version 2.0 (the "License");
13
- # you may not use this file except in compliance with the License.
14
- # You may obtain a copy of the License at
15
- # http://www.apache.org/licenses/LICENSE-2.0
16
- # Unless required by applicable law or agreed to in writing, software
17
- # distributed under the License is distributed on an "AS IS" BASIS,
18
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- # See the License for the specific language governing permissions and
20
- # limitations under the License.
21
- #------------------------------------------------------------------------------
22
- '''
23
- The Scientific experimental simulation library
24
- -------------------------------------------------------------------------------
25
- Graphen & Advanced Material Laboratory
26
-
27
- it aimes to provide new scientist to use data,simlation, prepared data
28
- and Artificial intelligence models.
29
-
30
- See http://gamlab.aut.ac.ir for complete documentation.
31
- '''
32
- __doc__='''
33
-
34
- @author: Ali Pilehvar Meibody (Alipilehvar1999@gmail.com)
35
-
36
- 888 888
37
- .d8888b .d88b. 88888b.d88b. 888 .d88b. 888
38
- d88P" d88""88b 888 "888 "88b 888 d88""88b 88888PP
39
- 888 8888 888 888 888 888 888 888 888 888 888 888
40
- Y88b. 88 Y88..88PP. 888 888 888 888...... Y88..88PP. 888 888
41
- "Y8888P8 "Y88P8888 888 888 888 888888888 "Y88P8888 88888888
42
-
43
-
44
- @Director of Gamlab: Professor M. Naderi (Mnaderi@aut.ac.ir)
45
-
46
- @Graphene Advanced Material Laboratory: https://www.GamLab.Aut.ac.ir
47
-
48
- '''
49
1
  import math
50
2
 
51
3
  # ==============================================================================
@@ -1,55 +1,3 @@
1
- '''
2
- Converters.py :
3
-
4
- This module provides converter functions for transforming values between different units of measurement.
5
- '''
6
-
7
- #" IN GOD WE TRUST, ALL OTHERS MUST BRING DATA"
8
- # -W. Edwards Deming
9
- #------------------------------------------------------------------------------
10
- # Copyright 2023 The Gamlab Authors. All Rights Reserved.
11
- # Licensed under the Apache License, Version 2.0 (the "License");
12
- # you may not use this file except in compliance with the License.
13
- # You may obtain a copy of the License at
14
- # http://www.apache.org/licenses/LICENSE-2.0
15
- # Unless required by applicable law or agreed to in writing, software
16
- # distributed under the License is distributed on an "AS IS" BASIS,
17
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- # See the License for the specific language governing permissions and
19
- # limitations under the License.
20
- #------------------------------------------------------------------------------
21
-
22
- '''
23
- The Scientific experimental simulation library
24
- -------------------------------------------------------------------------------
25
- Graphen & Advanced Material Laboratory
26
-
27
- it aimes to provide new scientist to use data,simlation, prepared data
28
- and Artificial intelligence models.
29
-
30
- See http://gamlab.aut.ac.ir for complete documentation.
31
- '''
32
- __doc__='''
33
-
34
- @author: Ali Pilehvar Meibody (Alipilehvar1999@gmail.com)
35
-
36
- 888 888
37
- .d8888b .d88b. 88888b.d88b. 888 .d88b. 888
38
- d88P" d88""88b 888 "888 "88b 888 d88""88b 88888PP
39
- 888 8888 888 888 888 888 888 888 888 888 888 888
40
- Y88b. 88 Y88..88PP. 888 888 888 888...... Y88..88PP. 888 888
41
- "Y8888P8 "Y88P8888 888 888 888 888888888 "Y88P8888 88888888
42
-
43
-
44
- @Director of Gamlab: Professor M. Naderi (Mnaderi@aut.ac.ir)
45
-
46
- @Graphene Advanced Material Laboratory: https://www.GamLab.Aut.ac.ir
47
-
48
-
49
- @Co-authors:
50
- '''
51
-
52
-
53
1
 
54
2
  import math
55
3
 
@@ -1,53 +1,3 @@
1
- '''
2
- Data_Analysis.py :
3
-
4
- '''
5
-
6
- #" IN GOD WE TRUST, ALL OTHERS MUST BRING DATA"
7
- # -W. Edwards Deming
8
- #------------------------------------------------------------------------------
9
- # Copyright 2023 The Gamlab Authors. All Rights Reserved.
10
- # Licensed under the Apache License, Version 2.0 (the "License");
11
- # you may not use this file except in compliance with the License.
12
- # You may obtain a copy of the License at
13
- # http://www.apache.org/licenses/LICENSE-2.0
14
- # Unless required by applicable law or agreed to in writing, software
15
- # distributed under the License is distributed on an "AS IS" BASIS,
16
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- # See the License for the specific language governing permissions and
18
- # limitations under the License.
19
- #------------------------------------------------------------------------------
20
- '''
21
- The Scientific experimental simulation library
22
- -------------------------------------------------------------------------------
23
- Graphen & Advanced Material Laboratory
24
-
25
- it aimes to provide new scientist to use data,simlation, prepared data
26
- and Artificial intelligence models.
27
-
28
- See http://gamlab.aut.ac.ir for complete documentation.
29
- '''
30
- __doc__='''
31
-
32
- @author: Ali Pilehvar Meibody (Alipilehvar1999@gmail.com)
33
-
34
- 888 888
35
- .d8888b .d88b. 88888b.d88b. 888 .d88b. 888
36
- d88P" d88""88b 888 "888 "88b 888 d88""88b 88888PP
37
- 888 8888 888 888 888 888 888 888 888 888 888 888
38
- Y88b. 88 Y88..88PP. 888 888 888 888...... Y88..88PP. 888 888
39
- "Y8888P8 "Y88P8888 888 888 888 888888888 "Y88P8888 88888888
40
-
41
-
42
- @Director of Gamlab: Professor M. Naderi (Mnaderi@aut.ac.ir)
43
-
44
- @Graphene Advanced Material Laboratory: https://www.GamLab.Aut.ac.ir
45
-
46
-
47
- @Co-authors:
48
- '''
49
-
50
-
51
1
  #import-----------------------------------------
52
2
  import math
53
3
  import statistics
@@ -4333,17 +4283,20 @@ def Stress_Strain6(data,application):
4333
4283
 
4334
4284
  def AerospaceAnalysis(dataframe, application):
4335
4285
  """
4336
- Parameters:
4337
- - dataframe: pandas.DataFrame
4286
+
4287
+ Parameters
4288
+ ----------
4289
+ dataframe : pandas.DataFrame
4338
4290
  Must contain two columns: ['Newton', 'Area'].
4339
4291
  Values should be in Newtons (N) and square meters (m²).
4340
- - application: str
4292
+ application : str
4341
4293
  One of ['plot', 'maxPressure'].
4342
4294
  'plot' → Plot Newton vs Area.
4343
4295
  'maxPressure' → Return maximum pressure value.
4344
4296
 
4345
4297
  Returns:
4346
- - float or None
4298
+ -------
4299
+ float or None
4347
4300
  Maximum pressure if application='maxPressure'.
4348
4301
  None if application='plot'.
4349
4302
  """
@@ -1,50 +1,3 @@
1
- '''
2
- Functions.py ==>
3
- '''
4
-
5
- #" IN GOD WE TRUST, ALL OTHERS MUST BRING DATA"
6
- # -W. Edwards Deming
7
- #------------------------------------------------------------------------------
8
- # Copyright 2023 The Gamlab Authors. All Rights Reserved.
9
- # Licensed under the Apache License, Version 2.0 (the "License");
10
- # you may not use this file except in compliance with the License.
11
- # You may obtain a copy of the License at
12
- # http://www.apache.org/licenses/LICENSE-2.0
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #------------------------------------------------------------------------------
19
- '''
20
- The Scientific experimental simulation library
21
- -------------------------------------------------------------------------------
22
- Graphen & Advanced Material Laboratory
23
-
24
- it aimes to provide new scientist to use data,simlation, prepared data
25
- and Artificial intelligence models.
26
-
27
- See http://gamlab.aut.ac.ir for complete documentation.
28
- '''
29
- __doc__='''
30
-
31
- @author: Ali Pilehvar Meibody (Alipilehvar1999@gmail.com)
32
-
33
- 888 888
34
- .d8888b .d88b. 88888b.d88b. 888 .d88b. 888
35
- d88P" d88""88b 888 "888 "88b 888 d88""88b 88888PP
36
- 888 8888 888 888 888 888 888 888 888 888 888 888
37
- Y88b. 88 Y88..88PP. 888 888 888 888...... Y88..88PP. 888 888
38
- "Y8888P8 "Y88P8888 888 888 888 888888888 "Y88P8888 88888888
39
-
40
-
41
- @Director of Gamlab: Professor M. Naderi (Mnaderi@aut.ac.ir)
42
-
43
- @Graphene Advanced Material Laboratory: https://www.GamLab.Aut.ac.ir
44
-
45
- '''
46
-
47
-
48
1
  #import-----------------------------------------
49
2
  import math
50
3
  import statistics
@@ -43,7 +43,7 @@ Y88b. 88 Y88..88PP. 888 888 888 888...... Y88..88PP. 888 888
43
43
  '''
44
44
 
45
45
 
46
- __version__ = "1.7.8"
46
+ __version__ = "1.8.0"
47
47
 
48
48
 
49
49
 
@@ -7,180 +7,7 @@ from sklearn.metrics import (
7
7
  classification_report, r2_score, mean_absolute_error, mean_squared_error
8
8
  )
9
9
 
10
- class GamAI_io:
11
- """
12
- A unified input/output handler for saving and loading `.gam_ai` model packages.
13
-
14
- This class encapsulates both machine learning model serialization and
15
- relevant metadata (e.g., author info, model parameters, training details)
16
- into a single portable `.gam_ai` file. It enables seamless model deployment,
17
- archival, and reproducibility by combining the binary model object and
18
- human-readable metadata in one structured JSON container.
19
-
20
- Parameters
21
- ----------
22
- model_name : str, optional
23
- A short, descriptive name for the model. Used as the filename during saving.
24
- model_type : str, optional
25
- The algorithmic or architectural family of the model
26
- (e.g., "RandomForest", "XGBoost", "CNN", "Transformer").
27
- description : str, optional, default=""
28
- A brief summary describing the model’s purpose, training dataset,
29
- or key features.
30
- author_name : str, optional, default=""
31
- Full name of the model creator.
32
- author_email : str, optional, default=""
33
- Contact email for correspondence or citation.
34
- trainer_name : str, optional, default=""
35
- The individual or system responsible for model training.
36
- best_accuracy : float, optional
37
- The highest validation or test accuracy achieved during training.
38
- doi : str, optional
39
- Digital Object Identifier (DOI) associated with the published model or dataset.
40
- hyperparam_range : dict, optional, default={}
41
- Dictionary defining hyperparameter search ranges used during optimization.
42
- best_params : dict, optional, default={}
43
- Dictionary of the final optimized hyperparameter values.
44
- ml_model : object, optional
45
- The trained machine learning model instance (e.g., scikit-learn estimator).
46
-
47
- Notes
48
- -----
49
- The `.gam_ai` file format consists of a JSON object with two main sections:
50
-
51
- - **metadata**: Contains descriptive fields such as author, model type,
52
- and hyperparameters.
53
- - **model_data**: Contains the Base64-encoded binary serialization of the
54
- trained model, produced via `joblib`.
55
-
56
- This approach ensures full portability and JSON readability, enabling
57
- both programmatic and manual inspection of model metadata.
58
-
59
- Examples
60
- --------
61
- >>> from gamai_io import GamAI_io
62
- >>> from sklearn.ensemble import RandomForestClassifier
63
- >>> model = RandomForestClassifier(n_estimators=100, random_state=42)
64
- >>> model.fit(X_train, y_train)
65
- >>>
66
- >>> package = GamAI_io(
67
- ... model_name="rf_classifier_v1",
68
- ... model_type="RandomForest",
69
- ... description="Predicts material phases using compositional data",
70
- ... author_name="John Doe",
71
- ... author_email="john.doe@example.com",
72
- ... best_accuracy=0.94,
73
- ... hyperparam_range={"n_estimators": [50, 100, 200]},
74
- ... best_params={"n_estimators": 100, "max_depth": 10},
75
- ... ml_model=model
76
- ... )
77
- >>>
78
- >>> # Save to file
79
- >>> package.save(save_dir="models")
80
- 💾 Saved ml_model package: models/rf_classifier_v1.gam_ai
81
- >>>
82
- >>> # Load from file
83
- >>> loaded_package = GamAI_io.load("models/rf_classifier_v1.gam_ai")
84
- >>> restored_model = loaded_package.ml_model
85
- >>> restored_model.predict(X_test[:5])
86
-
87
- See Also
88
- --------
89
- joblib.dump : Efficient serialization of Python objects.
90
- json : Standard JSON encoder/decoder.
91
- base64 : Encoding binary model data for safe JSON storage.
92
-
93
- """
94
-
95
- def __init__(self, **kwargs):
96
- self.model_name = kwargs.get("model_name")
97
- self.model_type = kwargs.get("model_type")
98
- self.description = kwargs.get("description", "")
99
- self.author_name = kwargs.get("author_name", "")
100
- self.author_email = kwargs.get("author_email", "")
101
- self.trainer_name = kwargs.get("trainer_name", "")
102
- self.best_accuracy = kwargs.get("best_accuracy", None)
103
- self.doi=kwargs.get("doi", None)
104
- self.hyperparam_range = kwargs.get("hyperparam_range", {})
105
- self.best_params = kwargs.get("best_params", {})
106
- self.ml_model = kwargs.get("ml_model", None)
107
-
108
- # ----------- Save ----------
109
- def save(self, save_dir="models"):
110
- """
111
- Serialize and save the current model and metadata as a `.gam_ai` package.
112
-
113
- Parameters
114
- ----------
115
- save_dir : str, optional, default="models"
116
- The target directory to save the `.gam_ai` file.
117
- The directory will be created if it does not exist.
118
-
119
- Raises
120
- ------
121
- ValueError
122
- If no model (`ml_model`) is attached to the current instance.
123
-
124
- Notes
125
- -----
126
- The model is serialized via `joblib` and encoded with Base64 to
127
- ensure JSON compatibility. The resulting file can be safely shared
128
- or uploaded to repositories without binary corruption.
129
-
130
- """
131
- os.makedirs(save_dir, exist_ok=True)
132
- filename = f"{self.model_name}.gam_ai"
133
- filepath = os.path.join(save_dir, filename)
134
10
 
135
- if self.ml_model is None:
136
- raise ValueError("No ml_model attached to save inside .gam_ai.")
137
-
138
- buffer = io.BytesIO()
139
- joblib.dump(self.ml_model, buffer)
140
- buffer.seek(0)
141
- encoded_model = base64.b64encode(buffer.read()).decode("utf-8")
142
-
143
- data = {
144
- "metadata": {k: v for k, v in self.__dict__.items() if k != "ml_model"},
145
- "model_data": encoded_model
146
- }
147
-
148
- with open(filepath, "w") as f:
149
- json.dump(data, f, indent=4)
150
- print(f"💾 Saved ml_model package: {filepath}")
151
-
152
- # ----------- Load ----------
153
- @staticmethod
154
- def load(filepath):
155
- """
156
- Load a `.gam_ai` model package from disk.
157
-
158
- Parameters
159
- ----------
160
- filepath : str
161
- Full path to the `.gam_ai` file to be loaded.
162
-
163
- Returns
164
- -------
165
- GamAI_io
166
- A `GamAI_io` instance containing both metadata and the
167
- deserialized machine learning model (`ml_model`).
168
-
169
- Notes
170
- -----
171
- The loading process reverses the Base64 encoding and `joblib`
172
- serialization to reconstruct the original model object.
173
-
174
- """
175
- with open(filepath, "r") as f:
176
- data = json.load(f)
177
- metadata = data["metadata"]
178
- model_data = base64.b64decode(data["model_data"])
179
- buffer = io.BytesIO(model_data)
180
- model = joblib.load(buffer)
181
- return GamAI_io(**metadata, model=model)
182
-
183
-
184
11
 
185
12
 
186
13
  class Gam_Ai_Workflow:
@@ -652,6 +479,180 @@ class GAM_AI_MODEL:
652
479
 
653
480
 
654
481
 
482
+ class GamAI_io:
483
+ """
484
+ A unified input/output handler for saving and loading `.gam_ai` model packages.
485
+
486
+ This class encapsulates both machine learning model serialization and
487
+ relevant metadata (e.g., author info, model parameters, training details)
488
+ into a single portable `.gam_ai` file. It enables seamless model deployment,
489
+ archival, and reproducibility by combining the binary model object and
490
+ human-readable metadata in one structured JSON container.
491
+
492
+ Parameters
493
+ ----------
494
+ model_name : str, optional
495
+ A short, descriptive name for the model. Used as the filename during saving.
496
+ model_type : str, optional
497
+ The algorithmic or architectural family of the model
498
+ (e.g., "RandomForest", "XGBoost", "CNN", "Transformer").
499
+ description : str, optional, default=""
500
+ A brief summary describing the model’s purpose, training dataset,
501
+ or key features.
502
+ author_name : str, optional, default=""
503
+ Full name of the model creator.
504
+ author_email : str, optional, default=""
505
+ Contact email for correspondence or citation.
506
+ trainer_name : str, optional, default=""
507
+ The individual or system responsible for model training.
508
+ best_accuracy : float, optional
509
+ The highest validation or test accuracy achieved during training.
510
+ doi : str, optional
511
+ Digital Object Identifier (DOI) associated with the published model or dataset.
512
+ hyperparam_range : dict, optional, default={}
513
+ Dictionary defining hyperparameter search ranges used during optimization.
514
+ best_params : dict, optional, default={}
515
+ Dictionary of the final optimized hyperparameter values.
516
+ ml_model : object, optional
517
+ The trained machine learning model instance (e.g., scikit-learn estimator).
518
+
519
+ Notes
520
+ -----
521
+ The `.gam_ai` file format consists of a JSON object with two main sections:
522
+
523
+ - **metadata**: Contains descriptive fields such as author, model type,
524
+ and hyperparameters.
525
+ - **model_data**: Contains the Base64-encoded binary serialization of the
526
+ trained model, produced via `joblib`.
527
+
528
+ This approach ensures full portability and JSON readability, enabling
529
+ both programmatic and manual inspection of model metadata.
530
+
531
+ Examples
532
+ --------
533
+ >>> from gamai_io import GamAI_io
534
+ >>> from sklearn.ensemble import RandomForestClassifier
535
+ >>> model = RandomForestClassifier(n_estimators=100, random_state=42)
536
+ >>> model.fit(X_train, y_train)
537
+ >>>
538
+ >>> package = GamAI_io(
539
+ ... model_name="rf_classifier_v1",
540
+ ... model_type="RandomForest",
541
+ ... description="Predicts material phases using compositional data",
542
+ ... author_name="John Doe",
543
+ ... author_email="john.doe@example.com",
544
+ ... best_accuracy=0.94,
545
+ ... hyperparam_range={"n_estimators": [50, 100, 200]},
546
+ ... best_params={"n_estimators": 100, "max_depth": 10},
547
+ ... ml_model=model
548
+ ... )
549
+ >>>
550
+ >>> # Save to file
551
+ >>> package.save(save_dir="models")
552
+ 💾 Saved ml_model package: models/rf_classifier_v1.gam_ai
553
+ >>>
554
+ >>> # Load from file
555
+ >>> loaded_package = GamAI_io.load("models/rf_classifier_v1.gam_ai")
556
+ >>> restored_model = loaded_package.ml_model
557
+ >>> restored_model.predict(X_test[:5])
558
+
559
+ See Also
560
+ --------
561
+ joblib.dump : Efficient serialization of Python objects.
562
+ json : Standard JSON encoder/decoder.
563
+ base64 : Encoding binary model data for safe JSON storage.
564
+
565
+ """
566
+
567
+ def __init__(self, **kwargs):
568
+ self.model_name = kwargs.get("model_name")
569
+ self.model_type = kwargs.get("model_type")
570
+ self.description = kwargs.get("description", "")
571
+ self.author_name = kwargs.get("author_name", "")
572
+ self.author_email = kwargs.get("author_email", "")
573
+ self.trainer_name = kwargs.get("trainer_name", "")
574
+ self.best_accuracy = kwargs.get("best_accuracy", None)
575
+ self.doi=kwargs.get("doi", None)
576
+ self.hyperparam_range = kwargs.get("hyperparam_range", {})
577
+ self.best_params = kwargs.get("best_params", {})
578
+ self.ml_model = kwargs.get("ml_model", None)
579
+
580
+ # ----------- Save ----------
581
+ def save(self, save_dir="models"):
582
+ """
583
+ Serialize and save the current model and metadata as a `.gam_ai` package.
584
+
585
+ Parameters
586
+ ----------
587
+ save_dir : str, optional, default="models"
588
+ The target directory to save the `.gam_ai` file.
589
+ The directory will be created if it does not exist.
590
+
591
+ Raises
592
+ ------
593
+ ValueError
594
+ If no model (`ml_model`) is attached to the current instance.
595
+
596
+ Notes
597
+ -----
598
+ The model is serialized via `joblib` and encoded with Base64 to
599
+ ensure JSON compatibility. The resulting file can be safely shared
600
+ or uploaded to repositories without binary corruption.
601
+
602
+ """
603
+ os.makedirs(save_dir, exist_ok=True)
604
+ filename = f"{self.model_name}.gam_ai"
605
+ filepath = os.path.join(save_dir, filename)
606
+
607
+ if self.ml_model is None:
608
+ raise ValueError("No ml_model attached to save inside .gam_ai.")
609
+
610
+ buffer = io.BytesIO()
611
+ joblib.dump(self.ml_model, buffer)
612
+ buffer.seek(0)
613
+ encoded_model = base64.b64encode(buffer.read()).decode("utf-8")
614
+
615
+ data = {
616
+ "metadata": {k: v for k, v in self.__dict__.items() if k != "ml_model"},
617
+ "model_data": encoded_model
618
+ }
619
+
620
+ with open(filepath, "w") as f:
621
+ json.dump(data, f, indent=4)
622
+ print(f"💾 Saved ml_model package: {filepath}")
623
+
624
+ # ----------- Load ----------
625
+ @staticmethod
626
+ def load(filepath):
627
+ """
628
+ Load a `.gam_ai` model package from disk.
629
+
630
+ Parameters
631
+ ----------
632
+ filepath : str
633
+ Full path to the `.gam_ai` file to be loaded.
634
+
635
+ Returns
636
+ -------
637
+ GamAI_io
638
+ A `GamAI_io` instance containing both metadata and the
639
+ deserialized machine learning model (`ml_model`).
640
+
641
+ Notes
642
+ -----
643
+ The loading process reverses the Base64 encoding and `joblib`
644
+ serialization to reconstruct the original model object.
645
+
646
+ """
647
+ with open(filepath, "r") as f:
648
+ data = json.load(f)
649
+ metadata = data["metadata"]
650
+ model_data = base64.b64decode(data["model_data"])
651
+ buffer = io.BytesIO(model_data)
652
+ model = joblib.load(buffer)
653
+ return GamAI_io(**metadata, model=model)
654
+
655
+
655
656
 
656
657
 
657
658
 
@@ -0,0 +1,29 @@
1
+ """
2
+ Structures subpackage for pygamlab:
3
+ Contains atomic primitives, nanostructure architectures, I/O utilities, and visualization.
4
+ """
5
+
6
+ from .Primatom import *
7
+ from .Generators import *
8
+ from .GAM_architectures import *
9
+ from .gamvis import *
10
+ from .io import *
11
+
12
+ __all__ = ['GAM_Atom', 'GAM_Bond', 'GAM_Molecule',
13
+ 'Nano_ZeroD_Builder', 'Nano_OneD_Builder', 'Nano_TwoD_Builder', 'AdvancedAlloys',
14
+ 'Graphene', 'Silicene', 'Phosphorene', 'Nanoparticle_Generator', 'Nanotube_Generator',
15
+ 'Molecular_Visualizer', 'GAMVisualizer',
16
+ 'read_structure', 'export', 'gam_to_ase', 'ase_to_gam', 'gam_to_pymatgen','pymatgen_to_gam','detect_format']
17
+
18
+
19
+
20
+
21
+ #__all__ = ['Primatom','Generator','GAM_architectures',
22
+ # 'gamvis',
23
+ # 'io']
24
+
25
+
26
+
27
+
28
+
29
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyGamLab
3
- Version: 1.7.8
3
+ Version: 1.9.8
4
4
  Summary: A scientific Python library with constants, unit convertors, formulas, and data analysis tools.
5
5
  Home-page: https://github.com/APMaii/pygamlab/tree/main
6
6
  Author: Ali Pilehvar Meibody
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PyGamLab"
7
- version = "1.7.8"
7
+ version = "1.9.8"
8
8
  description = "A scientific Python library with constants, unit convertors, formulas, and data analysis tools."
9
9
  authors = [
10
10
  { name="Ali Pilehvar Meibody", email="alipilehvar1999@Gmail.com" }
@@ -5,7 +5,7 @@ from setuptools import setup, find_packages
5
5
 
6
6
  setup(
7
7
  name="PyGamLab",
8
- version="1.7.8",
8
+ version="1.9.8",
9
9
  author="Ali Pilehvar Meibody",
10
10
  author_email="alipilehvar1999@gmail.com",
11
11
  description="A scientific Python library with constants, unit convertors, formulas, and data analysis tools.",