gitronics 0.3.2__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 (96) hide show
  1. gitronics-0.3.2/.github/workflows/publish.yml +28 -0
  2. gitronics-0.3.2/.gitignore +9 -0
  3. gitronics-0.3.2/.python-version +1 -0
  4. gitronics-0.3.2/LICENSE +157 -0
  5. gitronics-0.3.2/PKG-INFO +19 -0
  6. gitronics-0.3.2/README.md +6 -0
  7. gitronics-0.3.2/docs/source/_static/logo.png +0 -0
  8. gitronics-0.3.2/docs/source/conf.py +33 -0
  9. gitronics-0.3.2/docs/source/index.rst +139 -0
  10. gitronics-0.3.2/docs/source/requirements.txt +2 -0
  11. gitronics-0.3.2/example_project/assembled/assembled.mcnp +264 -0
  12. gitronics-0.3.2/example_project/assembled/assembled.metadata +1 -0
  13. gitronics-0.3.2/example_project/build_model.py +25 -0
  14. gitronics-0.3.2/example_project/configurations/small_override.yaml +3 -0
  15. gitronics-0.3.2/example_project/configurations/valid_configuration.yaml +9 -0
  16. gitronics-0.3.2/example_project/data_cards/fine_mesh.tally +19 -0
  17. gitronics-0.3.2/example_project/data_cards/materials.mat +9 -0
  18. gitronics-0.3.2/example_project/data_cards/my_transform.transform +3 -0
  19. gitronics-0.3.2/example_project/data_cards/volumetric_source.source +7 -0
  20. gitronics-0.3.2/example_project/models/envelope_structure.mcnp +217 -0
  21. gitronics-0.3.2/example_project/models/envelope_structure.metadata +0 -0
  22. gitronics-0.3.2/example_project/models/filler_model_1.mcnp +33 -0
  23. gitronics-0.3.2/example_project/models/filler_model_1.metadata +2 -0
  24. gitronics-0.3.2/example_project/models/filler_model_2.mcnp +33 -0
  25. gitronics-0.3.2/example_project/models/filler_model_2.metadata +2 -0
  26. gitronics-0.3.2/example_project/models/filler_model_3.mcnp +33 -0
  27. gitronics-0.3.2/example_project/models/filler_model_3.metadata +0 -0
  28. gitronics-0.3.2/pyproject.toml +31 -0
  29. gitronics-0.3.2/readthedocs.yaml +34 -0
  30. gitronics-0.3.2/src/gitronics/__init__.py +4 -0
  31. gitronics-0.3.2/src/gitronics/compose_model.py +42 -0
  32. gitronics-0.3.2/src/gitronics/file_discovery.py +29 -0
  33. gitronics-0.3.2/src/gitronics/file_readers.py +133 -0
  34. gitronics-0.3.2/src/gitronics/generate_model.py +130 -0
  35. gitronics-0.3.2/src/gitronics/helpers.py +37 -0
  36. gitronics-0.3.2/src/gitronics/project_checker.py +288 -0
  37. gitronics-0.3.2/src/gitronics/project_manager.py +143 -0
  38. gitronics-0.3.2/tests/test_compose_model.py +68 -0
  39. gitronics-0.3.2/tests/test_file_discovery.py +22 -0
  40. gitronics-0.3.2/tests/test_file_readers.py +215 -0
  41. gitronics-0.3.2/tests/test_generate_model.py +47 -0
  42. gitronics-0.3.2/tests/test_project_checker.py +189 -0
  43. gitronics-0.3.2/tests/test_project_manager.py +119 -0
  44. gitronics-0.3.2/tests/test_resources/duplicated_filename_project/duplicated_name.mat +0 -0
  45. gitronics-0.3.2/tests/test_resources/duplicated_filename_project/duplicated_name.mcnp +0 -0
  46. gitronics-0.3.2/tests/test_resources/duplicated_filename_project/duplicated_name.metadata +0 -0
  47. gitronics-0.3.2/tests/test_resources/expected_file_valid_configuration.mcnp +264 -0
  48. gitronics-0.3.2/tests/test_resources/invalid_suffix_project/my_file.wrong +0 -0
  49. gitronics-0.3.2/tests/test_resources/missing_metadata_project/my_file.mcnp +0 -0
  50. gitronics-0.3.2/tests/test_resources/valid_project/configurations/envelope_not_accounted.yaml +9 -0
  51. gitronics-0.3.2/tests/test_resources/valid_project/configurations/overrides_configuration.yaml +9 -0
  52. gitronics-0.3.2/tests/test_resources/valid_project/configurations/small_config.yaml +1 -0
  53. gitronics-0.3.2/tests/test_resources/valid_project/configurations/small_override.yaml +3 -0
  54. gitronics-0.3.2/tests/test_resources/valid_project/configurations/valid_configuration.yaml +9 -0
  55. gitronics-0.3.2/tests/test_resources/valid_project/data_cards/fine_mesh.tally +19 -0
  56. gitronics-0.3.2/tests/test_resources/valid_project/data_cards/materials.mat +9 -0
  57. gitronics-0.3.2/tests/test_resources/valid_project/data_cards/my_source.source +7 -0
  58. gitronics-0.3.2/tests/test_resources/valid_project/data_cards/my_transform.transform +3 -0
  59. gitronics-0.3.2/tests/test_resources/valid_project/data_cards/volumetric_source.source +7 -0
  60. gitronics-0.3.2/tests/test_resources/valid_project/models/envelope_structure.mcnp +217 -0
  61. gitronics-0.3.2/tests/test_resources/valid_project/models/envelope_structure.metadata +0 -0
  62. gitronics-0.3.2/tests/test_resources/valid_project/models/filler_model_1.mcnp +33 -0
  63. gitronics-0.3.2/tests/test_resources/valid_project/models/filler_model_1.metadata +2 -0
  64. gitronics-0.3.2/tests/test_resources/valid_project/models/filler_model_2.mcnp +33 -0
  65. gitronics-0.3.2/tests/test_resources/valid_project/models/filler_model_2.metadata +3 -0
  66. gitronics-0.3.2/tests/test_resources/valid_project/models/filler_model_3.mcnp +33 -0
  67. gitronics-0.3.2/tests/test_resources/valid_project/models/filler_model_3.metadata +0 -0
  68. gitronics-0.3.2/tests/test_resources/valid_project/models/my_envelope_structure.mcnp +217 -0
  69. gitronics-0.3.2/tests/test_resources/valid_project/models/my_envelope_structure.metadata +0 -0
  70. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/data_cards/fine_mesh.tally +19 -0
  71. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/data_cards/materials.mat +9 -0
  72. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/data_cards/my_transform.transform +3 -0
  73. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/data_cards/volumetric_source.source +7 -0
  74. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_env_struct.yaml +8 -0
  75. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_filler_path.yaml +9 -0
  76. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_materials_path.yaml +8 -0
  77. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_source_path.yaml +6 -0
  78. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_tallies_path.yaml +9 -0
  79. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_tr_for_filler.yaml +9 -0
  80. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_transforms_path.yaml +7 -0
  81. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/wrong_env_struct_path.yaml +9 -0
  82. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/wrong_envelope_name.yaml +9 -0
  83. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/models/envelope_structure.mcnp +217 -0
  84. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/models/envelope_structure.metadata +0 -0
  85. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_1.mcnp +33 -0
  86. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_1.metadata +2 -0
  87. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_2.mcnp +33 -0
  88. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_2.metadata +2 -0
  89. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_3.mcnp +33 -0
  90. gitronics-0.3.2/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_3.metadata +0 -0
  91. gitronics-0.3.2/tests/test_resources/wrong_files/only_cells_block.mcnp +5 -0
  92. gitronics-0.3.2/tests/test_resources/wrong_files/wrong_cells_block.mcnp +32 -0
  93. gitronics-0.3.2/tests/test_resources/wrong_files/wrong_data_card.mat +2 -0
  94. gitronics-0.3.2/tests/test_resources/wrong_files/wrong_suffix.wrong +0 -0
  95. gitronics-0.3.2/tests/test_resources/wrong_files/wrong_surfaces_block.mcnp +27 -0
  96. gitronics-0.3.2/uv.lock +295 -0
@@ -0,0 +1,28 @@
1
+ name: Publish Python Package
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - 'v*.*.*'
9
+
10
+ jobs:
11
+ deploy:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ id-token: write
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: '3.12'
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install build
25
+ - name: Build package
26
+ run: python -m build
27
+ - name: Publish package
28
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,9 @@
1
+ *.pyc
2
+ __pycache__/
3
+ *.egg-info/
4
+ src/_version.py
5
+ .coverage
6
+ .assembled
7
+ docs/_build/
8
+ make.bat
9
+ Makefile
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,157 @@
1
+ EUROPEAN UNION PUBLIC LICENCE v. 1.2
2
+ EUPL © the European Union 2007, 2016
3
+
4
+ This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined below) which is provided under the terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such use is covered by a right of the copyright holder of the Work).
5
+
6
+ The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following notice immediately following the copyright notice for the Work:
7
+
8
+ Licensed under the EUPL
9
+
10
+ or has expressed by any other means his willingness to license under the EUPL.
11
+
12
+ 1. Definitions
13
+ In this Licence, the following terms have the following meaning:
14
+
15
+ — ‘The Licence’: this Licence.
16
+
17
+ — ‘The Original Work’: the work or software distributed or communicated by the Licensor under this Licence, available as Source Code and also as Executable Code as the case may be.
18
+
19
+ — ‘Derivative Works’: the works or software that could be created by the Licensee, based upon the Original Work or modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in the country mentioned in Article 15.
20
+
21
+ — ‘The Work’: the Original Work or its Derivative Works.
22
+
23
+ — ‘The Source Code’: the human-readable form of the Work which is the most convenient for people to study and modify.
24
+
25
+ — ‘The Executable Code’: any code which has generally been compiled and which is meant to be interpreted by a computer as a program.
26
+
27
+ — ‘The Licensor’: the natural or legal person that distributes or communicates the Work under the Licence.
28
+
29
+ — ‘Contributor(s)’: any natural or legal person who modifies the Work under the Licence, or otherwise contributes to the creation of a Derivative Work.
30
+
31
+ — ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of the Work under the terms of the Licence.
32
+
33
+ — ‘Distribution’ or ‘Communication’: any act of selling, giving, lending, renting, distributing, communicating, transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential functionalities at the disposal of any other natural or legal person.
34
+
35
+ 2. Scope of the rights granted by the Licence
36
+ The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for the duration of copyright vested in the Original Work:
37
+
38
+ — use the Work in any circumstance and for all usage,
39
+
40
+ — reproduce the Work,
41
+
42
+ — modify the Work, and make Derivative Works based upon the Work,
43
+
44
+ — communicate to the public, including the right to make available or display the Work or copies thereof to the public and perform publicly, as the case may be, the Work,
45
+
46
+ — distribute the Work or copies thereof,
47
+
48
+ — lend and rent the Work or copies thereof,
49
+
50
+ — sublicense rights in the Work or copies thereof.
51
+
52
+ Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the applicable law permits so.
53
+
54
+ In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed by law in order to make effective the licence of the economic rights here above listed.
55
+
56
+ The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the extent necessary to make use of the rights granted on the Work under this Licence.
57
+
58
+ 3. Communication of the Source Code
59
+ The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to distribute or communicate the Work.
60
+
61
+ 4. Limitations on copyright
62
+ Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations thereto.
63
+
64
+ 5. Obligations of the Licensee
65
+ The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those obligations are the following:
66
+
67
+ Attribution right: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the Licence with every copy of the Work he/she distributes or communicates. The Licensee must cause any Derivative Work to carry prominent notices stating that the Work has been modified and the date of modification.
68
+ Copyleft clause: If the Licensee distributes or communicates copies of the Original Works or Derivative Works, this Distribution or Communication will be done under the terms of this Licence or of a later version of this Licence unless the Original Work is expressly distributed only under this version of the Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the Work or Derivative Work that alter or restrict the terms of the Licence.
69
+ Compatibility clause: If the Licensee Distributes or Communicates Derivative Works or copies thereof based upon both the Work and another work licensed under a Compatible Licence, this Distribution or Communication can be done under the terms of this Compatible Licence. For the sake of this clause, ‘Compatible Licence’ refers to the licences listed in the appendix attached to this Licence. Should the Licensee's obligations under the Compatible Licence conflict with his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail.
70
+ Provision of Source Code: When distributing or communicating copies of the Work, the Licensee will provide a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available for as long as the Licensee continues to distribute or communicate the Work.
71
+ Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the copyright notice.
72
+ 6. Chain of Authorship
73
+ The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or licensed to him/her and that he/she has the power and authority to grant the Licence.
74
+
75
+ Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or licensed to him/her and that he/she has the power and authority to grant the Licence.
76
+
77
+ Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contri­ butions to the Work, under the terms of this Licence.
78
+
79
+ 7. Disclaimer of Warranty
80
+ The Work is a work in progress, which is continuously improved by numerous Contributors. It is not a finished work and may therefore contain defects or ‘bugs’ inherent to this type of development.
81
+
82
+ For the above reason, the Work is provided under the Licence on an ‘as is’ basis and without warranties of any kind concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this Licence.
83
+
84
+ This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work.
85
+
86
+ 8. Disclaimer of Liability
87
+ Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However, the Licensor will be liable under statutory product liability laws as far such laws apply to the Work.
88
+
89
+ 9. Additional agreements
90
+ While distributing the Work, You may choose to conclude an additional agreement, defining obligations or services consistent with this Licence. However, if accepting obligations, You may act only on your own behalf and on your sole responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by the fact You have accepted any warranty or additional liability.
91
+
92
+ 10. Acceptance of the Licence
93
+ The provisions of this Licence can be accepted by clicking on an icon ‘I agree’ placed under the bottom of a window displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms and conditions.
94
+
95
+ Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution or Communication by You of the Work or copies thereof.
96
+
97
+ 11. Information to the public
98
+ In case of any Distribution or Communication of the Work by means of electronic communication by You (for example, by offering to download the Work from a remote location) the distribution channel or media (for example, a website) must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence and the way it may be accessible, concluded, stored and reproduced by the Licensee.
99
+
100
+ 12. Termination of the Licence
101
+ The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms of the Licence.
102
+
103
+ Such a termination will not terminate the licences of any person who has received the Work from the Licensee under the Licence, provided such persons remain in full compliance with the Licence.
104
+
105
+ 13. Miscellaneous
106
+ Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the Work.
107
+
108
+ If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or enforceability of the Licence as a whole. Such provision will be construed or reformed so as necessary to make it valid and enforceable.
109
+
110
+ The European Commission may publish other linguistic versions or new versions of this Licence or updated versions of the Appendix, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence. New versions of the Licence will be published with a unique version number.
111
+
112
+ All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take advantage of the linguistic version of their choice.
113
+
114
+ 14. Jurisdiction
115
+ Without prejudice to specific agreement between parties,
116
+
117
+ — any litigation resulting from the interpretation of this License, arising between the European Union institutions, bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union,
118
+
119
+ — any litigation arising between other parties and resulting from the interpretation of this License, will be subject to the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business.
120
+
121
+ 15. Applicable Law
122
+ Without prejudice to specific agreement between parties,
123
+
124
+ — this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat, resides or has his registered office,
125
+
126
+ — this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside a European Union Member State.
127
+
128
+ Appendix
129
+ ‘Compatible Licences’ according to Article 5 EUPL are:
130
+
131
+ — GNU General Public License (GPL) v. 2, v. 3
132
+
133
+ — GNU Affero General Public License (AGPL) v. 3
134
+
135
+ — Open Software License (OSL) v. 2.1, v. 3.0
136
+
137
+ — Eclipse Public License (EPL) v. 1.0
138
+
139
+ — CeCILL v. 2.0, v. 2.1
140
+
141
+ — Mozilla Public Licence (MPL) v. 2
142
+
143
+ — GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
144
+
145
+ — Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for works other than software
146
+
147
+ — European Union Public Licence (EUPL) v. 1.1, v. 1.2
148
+
149
+ — Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong Reciprocity (LiLiQ-R+)
150
+
151
+ The European Commission may update this Appendix to later versions of the above licences without producing a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the covered Source Code from exclusive appropriation.
152
+
153
+ All other changes or additions to this Appendix require the production of a new EUPL version.
154
+
155
+ This website is not sponsored or endorsed by the European Commission or any other institution, body or agency of the European Union.
156
+
157
+ Created by Javier Casares (legal) under license EUPL 1.2.
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 2.4
2
+ Name: gitronics
3
+ Version: 0.3.2
4
+ Summary: Automatically build an MCNP from a set of files.
5
+ Author-email: Alvaro Cubi <cubiric@hotmail.com>
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.13
8
+ Requires-Dist: pip>=25.2
9
+ Requires-Dist: polars>=1.33.1
10
+ Requires-Dist: pyyaml>=6.0.2
11
+ Requires-Dist: xlsxwriter>=3.2.9
12
+ Description-Content-Type: text/markdown
13
+
14
+ ![Gitronics Logo](docs/source/_static/logo.png)
15
+
16
+ # Gitronics
17
+ A tool to manage and automatically build an MCNP model from a set of files.
18
+
19
+ Please check the online documentation for installation and how to use: https://gitronics.readthedocs.io/en/latest/
@@ -0,0 +1,6 @@
1
+ ![Gitronics Logo](docs/source/_static/logo.png)
2
+
3
+ # Gitronics
4
+ A tool to manage and automatically build an MCNP model from a set of files.
5
+
6
+ Please check the online documentation for installation and how to use: https://gitronics.readthedocs.io/en/latest/
@@ -0,0 +1,33 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # For the full list of built-in configuration values, see the documentation:
4
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
+
6
+ # -- Project information -----------------------------------------------------
7
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
+
9
+ project = 'Gitronics'
10
+ copyright = '2025, Alvaro Cubi'
11
+ author = 'Alvaro Cubi'
12
+ release = '1.4'
13
+
14
+ # -- General configuration ---------------------------------------------------
15
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
16
+
17
+ extensions = ["sphinx.ext.autosectionlabel"]
18
+
19
+ templates_path = ['_templates']
20
+ exclude_patterns = []
21
+
22
+
23
+
24
+ # -- Options for HTML output -------------------------------------------------
25
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
26
+
27
+ html_theme = "pydata_sphinx_theme"
28
+ html_static_path = ["_static"]
29
+ html_logo = "_static/logo.png"
30
+ html_sidebars = {"**": []}
31
+ html_theme_options = {
32
+ "secondary_sidebar_items": ["page-toc"],
33
+ }
@@ -0,0 +1,139 @@
1
+ .. Gitronics documentation master file, created by
2
+ sphinx-quickstart on Mon Apr 7 19:01:49 2025.
3
+ You can adapt this file completely to your liking, but it should at least
4
+ contain the root `toctree` directive.
5
+
6
+ Gitronics documentation
7
+ =======================
8
+
9
+ Welcome to the Gironics documentation. Gitronics is a Python package that allows the
10
+ modularization of MCNP models. It is designed to help users create and manage complex
11
+ MCNP models by breaking them down into smaller, single-responsibility files.
12
+
13
+ Installation
14
+ ============
15
+
16
+ To install Gitronics you can clone the repository and then install it in a Python
17
+ environment using pip.
18
+
19
+ How to use
20
+ ==========
21
+
22
+ Inside the Gitronics package there is a folder called *example_project*. This folder
23
+ can serve as a template for your own projects as it contains a working example of a
24
+ MCNP model using Gitronics.
25
+
26
+ Your project may have a different directory structure, it does not matter where each
27
+ file is stored or how they are grouped, as long as the paths in the `build_model.py`
28
+ script and the `project_summary.csv` are correctly set.
29
+
30
+ Philosophy
31
+ ----------
32
+
33
+ The philosophy behind Gitronics is to consider an MCNP reference model as a project
34
+ that contains several files representing the different data that would define a MCNP
35
+ model like the geometry of a system, material definitions, particle sources, tallies,
36
+ etc.
37
+ Then, according to a configuration file, Gitronics will automatically compile all the
38
+ different files into a single MCNP input file which will be referred as
39
+ `assembled.mcnp`.
40
+
41
+ In Gitronics, there are 6 types of files:
42
+
43
+ - Main input file:
44
+ Can also be called envelope structure. This file contains the
45
+ envelope cells that will be filled by universe models. In the case of a simple model
46
+ without universes, this file will contain the geometry of the system. It has the
47
+ suffix `.mcnp`.
48
+ - Universe model:
49
+ This file contains the geometry of a MCNP universe which often
50
+ represents a specific system. The project can contain many universe models, and not
51
+ all of them may be needed for a specific configuration. They have the suffix `.mcnp`.
52
+ - Data cards:
53
+ These files contain the data cards that may be used in the MCNP input
54
+ file. They can be used to define materials, sources, tallies, etc. They have the
55
+ suffix `.mat`, `.source`, `.tally` or `transform`. Only a single `.source` file is
56
+ allowed to be selected in a configuration.
57
+ - Configuration files:
58
+ Each of these files represent a specific configuration of the
59
+ project. They are used to select which files will be included in the final MCNP
60
+ input file. They are in YAML format.
61
+ - Project summary:
62
+ This file contains information about each of the other files of
63
+ the project. It is needed to build the `assembled.mcnp`.
64
+ - Building script:
65
+ This script is used to build the `assembled.mcnp` file. It is a
66
+ Python file that makes use of the Gitronics package. It is called `build_model.py`.
67
+
68
+ Main input file
69
+ ---------------
70
+
71
+ This file contains the envelope cells that will be filled with universes models. To
72
+ define a cell as an envelope, it must include a comment of the form `$ FILL = <name>`,
73
+ where `<name>` is the name of the envelope (e.g. `$ FILL = Equatorial Port 04`).
74
+
75
+ Universe model
76
+ --------------
77
+
78
+ The file contains the geometry of a MCNP universe. There should be no title card at
79
+ the beginning of the file. The cells should contain the `U = <universe id>` card that
80
+ defines them as a universe.
81
+
82
+ Data cards
83
+ ----------
84
+
85
+ The file represents a data card or set of data cards that may be included in the MCNP
86
+ model. Anything written after a blank line will not be considered.
87
+
88
+ Configuration files
89
+ -------------------
90
+
91
+ A configuration file is a YAML file used to select which files will be included in the
92
+ `assembled.mcnp` file. The fields in the configuration are filled with names of other
93
+ files. These names are not the file name of the file but a given name that is defined in
94
+ the project summary file.
95
+ The configuration may contain any of the following fields:
96
+
97
+ - overrides:
98
+ This field can be filled with the name of another configuration file that
99
+ will serve as default. Any other field filled will override the default value.
100
+ - envelope_structure:
101
+ The name of the main input file.
102
+ - envelopes:
103
+ Filled with a dict of the form:
104
+ ``{<envelope name>: {filler: <universe name>, transform: <transform>}}``. The envelope name
105
+ must be the same as the one used in the main input file. The transform is optional,
106
+ and is a string that will be added after the ``FILL = 123`` card and therefore can be used
107
+ to define a transformation like in ``FILL = 123 10 10 10``.
108
+ - source:
109
+ The name of the source file. Only one source file is allowed.
110
+ - tallies:
111
+ A list of the names of the tally files that will be included in the MCNP
112
+ model.
113
+ - materials:
114
+ A list of the names of the material files that will be included in the
115
+ MCNP model.
116
+ - transforms:
117
+ A list of the names of the transform files that will be included in the
118
+ MCNP model.
119
+
120
+ Project summary
121
+ ---------------
122
+
123
+ It is a CSV file that can contain any information the user wants to add about the
124
+ files. It is mandatory to include as the first two columns: *Name* and *Relative path*.
125
+ Each row represents a file in the project. The *Name* column is the name that will be
126
+ used in the configuration file. The *Relative path* column is the path to the file
127
+ relative to the project root.
128
+
129
+ Building script
130
+ ---------------
131
+
132
+ The user should update the paths inside the script before running it. In the script, it
133
+ is specified which configuration file will be used. Run the script to generated the
134
+ `assembled.mcnp` file.
135
+
136
+ .. toctree::
137
+ :maxdepth: 2
138
+ :caption: Contents:
139
+
@@ -0,0 +1,2 @@
1
+ sphinx
2
+ pydata-sphinx-theme