Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import json bug #2

Closed
wants to merge 12 commits into from
2 changes: 1 addition & 1 deletion .github/workflows/documentation_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
35 changes: 25 additions & 10 deletions docs/developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -168,7 +181,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
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -214,7 +234,7 @@ For example adding version 1.2.3 would look like this

Then create a `pull request from dev branch to main branch <https://github.com/GEOUNED-org/GEOUNED/compare/main...dev>`_

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 <https://github.com/shimwell/GEOUNED/releases/new>`_ with the version number and a description of the changes.

Expand All @@ -235,17 +255,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 <https://github.com/conda-forge/geouned-feedstock/pulls>`_ repository.
The pull request will be generated in the `conda-forge/GEOUNED-feedstock <https://github.com/conda-forge/geouned-feedstock/pulls>`_ 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 <https://anaconda.org/conda-forge/geouned>`_.

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 <https://anaconda.org/conda-forge/geouned>`_.
10 changes: 0 additions & 10 deletions docs/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/python_cadtocsg_api_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/python_cadtocsg_cli_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions docs/version_switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
3 changes: 1 addition & 2 deletions src/geouned/GEOUNED/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand All @@ -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"])
Expand Down
7 changes: 7 additions & 0 deletions src/geouned/GEOUNED/utils/boolean_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,14 @@ def append(self, *seq):
"""Append a BoolSequence Objects. seq may be :
- An iterable containing allowed BoolSequence Objects
- A BoolSequence object
- An integer value
- A Boolean value
- A bsurface object"""

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 bsurface:
Expand Down
4 changes: 2 additions & 2 deletions src/geouned/GEOUNED/utils/data_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/config_cadtocsg_complete_defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"matFile": "",
"voidGen": true,
"debug": false,
"compSolids": true,
"compSolids": false,
"simplify": "no",
"exportSolids": "",
"minVoidSize": 200.0,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cadtocsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading