From 7791250d4591e4b8d3e0394b008085d9884c4261 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Tue, 18 Jun 2024 09:15:32 +0100 Subject: [PATCH 1/8] Update docs badge with new action name (#238) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d1d0e6a9..71dcb5f3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![CI testing](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/ci.yml) [![Upload Python Package](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/python-publish.yml/badge.svg)](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/python-publish.yml) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black) -[![documentation](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/documentation.yml/badge.svg)](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/documentation.yml) +[![documentation release](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/documentation_release.yml/badge.svg)](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/documentation_release.yml) [![PyPI](https://img.shields.io/pypi/v/geouned?&label=PyPI)](https://pypi.org/project/geouned/) [![Anaconda-Server Badge](https://anaconda.org/conda-forge/geouned/badges/version.svg)](https://anaconda.org/conda-forge/geouned) From 1da76724cd8b2ef04d4165ea6ca267bd074884e0 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Tue, 18 Jun 2024 09:17:47 +0100 Subject: [PATCH 2/8] Added version 1.2 to docs versions (#236) --- docs/version_switcher.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/version_switcher.json b/docs/version_switcher.json index 3f86e201..8a66d4f3 100644 --- a/docs/version_switcher.json +++ b/docs/version_switcher.json @@ -8,5 +8,10 @@ "name": "1.1.0", "version": "1.1.0", "url": "https://geouned-org.github.io/GEOUNED/1.1.0" + }, + { + "name": "1.2.0", + "version": "1.2.0", + "url": "https://geouned-org.github.io/GEOUNED/1.2.0" } -] \ No newline at end of file +] From e242565328532af2b45ae2de1662f9e9ee7e0336 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Tue, 18 Jun 2024 11:25:02 +0100 Subject: [PATCH 3/8] added merge type for dev to main (#243) --- docs/developer_guide.rst | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst index 4442c148..7190c6b5 100644 --- a/docs/developer_guide.rst +++ b/docs/developer_guide.rst @@ -168,7 +168,14 @@ Tests checking the code will run automatically on the pull request. If the tests pass and at least one approver approves then the pull request can be merged. -When a pull request is ready to be merged then the pull request should be **squashed** and merged into the dev branch. +When updating the dev branch from a feature branch then a pull request is should be merged in with the **squashed and merged*** option. + +When updating the main branch from the dev branch then the pull request should be merged in with the **create a merge commit** option. + +Version numbering +~~~~~~~~~~~~~~~~~ + +GEOUNED will use Semantic Versioning to number releases of the tool, in the form "Major.Minor.Patch", e.g., “3.15.9”. Releasing a new version ~~~~~~~~~~~~~~~~~~~~~~~ @@ -214,7 +221,7 @@ For example adding version 1.2.3 would look like this Then create a `pull request from dev branch to main branch `_ -Once the tests for this pass then merge the pull request in. **Do not squash** this pull request as we want to keep the history of the version changes. +Once the tests for this pass then merge the pull request in. Use the **create a merge commit** option when merging this pull request from dev to main. Then `create a new release on the main branch `_ with the version number and a description of the changes. @@ -235,17 +242,12 @@ Conda Forge Releasing The conda-forge package release is done after the PyPI release. This is because the conda-forge package is built from the PyPI package. -Conda Forge has a bot thew generates a pull request to update the conda-forge recipe. This is done automatically when the PyPI package is released. +Conda Forge has a bot that generates a pull request to update the conda-forge recipe. This is done automatically when the PyPI package is released. -The pull request will be generated in the `conda-forge/GEOUNED-feedstock `_ repository. +The pull request will be generated in the `conda-forge/GEOUNED-feedstock `_ repository a short while after the PyPI release. Check the pull request and if the tests pass then merge the pull request. A Conda Forge package will be built and released to the conda-forge channel. -Once released the package will be visaible on the `conda-forge channel `_. - -Version Numbering -~~~~~~~~~~~~~~~~~ - -GEOUNED will use Semantic Versioning to number releases of the tool, in the form "Major.Minor.Patch", e.g., “3.15.9”. +Once released the package will be visible on the `conda-forge channel `_. From 629ec26cdfb47bd2a2ec9b22f34e41a606666096 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Tue, 18 Jun 2024 11:25:29 +0100 Subject: [PATCH 4/8] removed trailing / (#244) --- .github/workflows/documentation_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation_release.yml b/.github/workflows/documentation_release.yml index d154a523..e46a9425 100644 --- a/.github/workflows/documentation_release.yml +++ b/.github/workflows/documentation_release.yml @@ -43,7 +43,7 @@ jobs: with: publish_branch: gh-pages github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: _build/ + publish_dir: _build # with next rlease of actions-gh-pages # issue to allow force_orphan will be fixed # https://github.com/peaceiris/actions-gh-pages/issues/455 From c433561f0a6558046c6d4b1c15f67321602e7355 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 19 Jun 2024 14:45:39 +0100 Subject: [PATCH 5/8] moved git tags info into dev install (#245) --- docs/developer_guide.rst | 13 +++++++++++++ docs/install/index.rst | 10 ---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst index 7190c6b5..56bc9d22 100644 --- a/docs/developer_guide.rst +++ b/docs/developer_guide.rst @@ -105,6 +105,19 @@ Checkout feature branches from dev and make local changes on you own branch Pull requests are welcome +Keeping your fork tags up to date +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Note that your fork of the repository should have releases tags which conform to PEP440 i.e. semantic versioning. +When installing, setuptools uses these tags to get the version of GEOUNED. +Release versions in the central repository conform to this standard. +You can keep the tags in your fork up to date with the main repository using: + +.. code-block:: sh + + git fetch --tags https://github.com/GEOUNED-org/GEOUNED + + Building the docs locally ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/install/index.rst b/docs/install/index.rst index 20f3ee08..be94dbe8 100644 --- a/docs/install/index.rst +++ b/docs/install/index.rst @@ -9,17 +9,7 @@ Currently the Mamba / Conda install is the recommended method. The main complication when installing GEOUNED is integration between the main dependency (FreeCAD) and the users system Python. Mamba / Conda provides a connection between the FreeCAD Python library and your system Python. Users have also had success installing FreeCAD and making use of the Python version inbuilt into FreeCAD and the freecad.cmd however the integration of FrreCAD with the system Python is more challenging when installing in this manner. -.. TODO as well so these installation methods are listed for completeness. -Note that your fork of the repostory must have releases which conform to PEP440 i.e. semantic versioning. When installing, setuptools -uses these tags to get the release number of GEOUNED. Release versions in the central repository now conform to this standard and can be reflected in your -fork using: - -.. code-block:: sh - - git fetch --tags upstream - -where upstream is the remote url of the original repository. .. toctree:: :numbered: From d8cd90a92bd884c603d7d98e55e01dc237ded368 Mon Sep 17 00:00:00 2001 From: Patrick Sauvan Date: Tue, 25 Jun 2024 15:30:45 +0200 Subject: [PATCH 6/8] Append sequence on BoolSequence with boolean value (#247) --- src/geouned/GEOUNED/utils/boolean_function.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/geouned/GEOUNED/utils/boolean_function.py b/src/geouned/GEOUNED/utils/boolean_function.py index 2e48b1f0..a9bc2e4a 100644 --- a/src/geouned/GEOUNED/utils/boolean_function.py +++ b/src/geouned/GEOUNED/utils/boolean_function.py @@ -43,6 +43,12 @@ def append(self, *seq): - A BoolSequence object - An integer value - A Boolean value""" + + if type(self.elements) is bool: + if (self.elements and self.operator == "AND") or (not self.elements and self.operator == "OR"): + self.assign(seq) + return + for s in seq: if type(s) is int: level = -1 From c14ad1d85d0788b1fc326953a20ce20c9a6f3c07 Mon Sep 17 00:00:00 2001 From: Alex Valentine <40658938+alexvalentine94@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:27:53 +0100 Subject: [PATCH 7/8] change default compSolids behaviour (#246) * change default compSolids behaviour * update test with new default --- docs/usage/python_cadtocsg_api_usage.rst | 2 +- docs/usage/python_cadtocsg_cli_usage.rst | 2 +- src/geouned/GEOUNED/utils/data_classes.py | 4 ++-- tests/config_cadtocsg_complete_defaults.json | 2 +- tests/test_cadtocsg.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/usage/python_cadtocsg_api_usage.rst b/docs/usage/python_cadtocsg_api_usage.rst index eefc973e..7d3942f2 100644 --- a/docs/usage/python_cadtocsg_api_usage.rst +++ b/docs/usage/python_cadtocsg_api_usage.rst @@ -42,7 +42,7 @@ The following example shows a usage with every attributes specified. matFile="", voidGen=True, debug=False, - compSolids=True, + compSolids=False, simplify="no", exportSolids="", minVoidSize=200.0, diff --git a/docs/usage/python_cadtocsg_cli_usage.rst b/docs/usage/python_cadtocsg_cli_usage.rst index ffdd2c83..ec00218d 100644 --- a/docs/usage/python_cadtocsg_cli_usage.rst +++ b/docs/usage/python_cadtocsg_cli_usage.rst @@ -88,7 +88,7 @@ Here is a complete JSON file specification "matFile": "", "voidGen": true, "debug": false, - "compSolids": true, + "compSolids": false, "simplify": "no", "exportSolids": "", "minVoidSize": 200.0, diff --git a/src/geouned/GEOUNED/utils/data_classes.py b/src/geouned/GEOUNED/utils/data_classes.py index 32ac49ae..1eb9a6b7 100644 --- a/src/geouned/GEOUNED/utils/data_classes.py +++ b/src/geouned/GEOUNED/utils/data_classes.py @@ -605,7 +605,7 @@ class Settings: that solids defined has separated solids are read by FreeCAD as a single compound solid (and will produce only one MCNP cell). In this case compSolids should be set to False. Defaults - to True. + to False. simplify (str, optional): Simplify the cell definition considering relative surfaces position and using Boolean logics. Available options are: "no" no optimization, "void" only void cells are @@ -641,7 +641,7 @@ def __init__( matFile: str = "", voidGen: bool = True, debug: bool = False, - compSolids: bool = True, + compSolids: bool = False, simplify: str = "no", exportSolids: typing.Optional[str] = None, minVoidSize: float = 200.0, # units mm diff --git a/tests/config_cadtocsg_complete_defaults.json b/tests/config_cadtocsg_complete_defaults.json index 496fe5c7..6f6b7916 100644 --- a/tests/config_cadtocsg_complete_defaults.json +++ b/tests/config_cadtocsg_complete_defaults.json @@ -53,7 +53,7 @@ "matFile": "", "voidGen": true, "debug": false, - "compSolids": true, + "compSolids": false, "simplify": "no", "exportSolids": "", "minVoidSize": 200.0, diff --git a/tests/test_cadtocsg.py b/tests/test_cadtocsg.py index 26137237..16b3eab8 100644 --- a/tests/test_cadtocsg.py +++ b/tests/test_cadtocsg.py @@ -81,7 +81,7 @@ def test_conversion(input_step_file): matFile="", voidGen=True, debug=False, - compSolids=True, + compSolids=False, simplify="no", exportSolids="", minVoidSize=200.0, # units mm From d9fc3171e32ef2ea40059a2edfd1dbfa9df1706d Mon Sep 17 00:00:00 2001 From: Patrick Sauvan Date: Sat, 29 Jun 2024 23:01:29 +0200 Subject: [PATCH 8/8] fix bug in "from_json" method --- src/geouned/GEOUNED/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/geouned/GEOUNED/core.py b/src/geouned/GEOUNED/core.py index 0125f4d5..b003639d 100644 --- a/src/geouned/GEOUNED/core.py +++ b/src/geouned/GEOUNED/core.py @@ -230,8 +230,6 @@ def from_json(cls, filename: str): cad_to_csg = cls() - cad_to_csg.load_step_file(**config["load_step_file"]) - for key in config.keys(): if key in ["load_step_file", "export_csg"]: @@ -254,6 +252,7 @@ def from_json(cls, filename: str): f"Invalid key '{key}' found in config file {filename}. Acceptable key names are 'load_step_file', 'export_csg', 'Settings', 'Parameters', 'Tolerances' and 'NumericFormat'" ) + cad_to_csg.load_step_file(**config["load_step_file"]) cad_to_csg.start() if "export_csg" in config.keys(): cad_to_csg.export_csg(**config["export_csg"])