Skip to content

Commit f32b840

Browse files
committed
ADD: extra info and corrections on how to develop
1 parent cda8985 commit f32b840

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,32 @@ That's it you are now a contributor to the diffCheck! We raccomand to not downlo
8888

8989
## GHPy: B) development/debug
9090

91-
### Code structure
91+
### B.1) Code structure
9292
For DiffCheck there are 2 main folders in the repository:
9393
* `src/gh/diffCheck/components` here you can add new components or modify existing ones (for more info on how to create one we point you to [this documentation](https://github.com/compas-dev/compas-actions.ghpython_components)). Here we call the
9494
* `src/gh/diffCheck/diffCheck` this is our package where the core functionalities are implemented.
9595

96-
### IDE
96+
### B.2) Developing component's content
97+
The idea is to start by developing the content of the component in the file `src/gh/diffCheck/diffCgeck_app.py`. This would be a simple script that contains the logic of the component. Once the script `diffCheck_app.py` is working correctly, you can move the code to the component file in the `src/gh/diffCheck/components` folder. This is because the component file is the one that will be componentized and distributed via yak.
98+
9799
We reccomand to use `VSCode` as IDE for developing the components. This is because it has a good integration with the `Grasshopper` environment and it is easy to debug the components. To set up the IDE follow these steps:
98100
1. Install the `ScriptSync` extension for `VSCode`.
99101
2. Install the `ScriptSync` from the yak manager in Rhino.
100-
3. Open the `code.py` from the `src/gh/diffCheck/components` folder you are working on in `VSCode`, and set its path to the ScriptSync ghcomponent.
102+
3. Open the `diffCheckApp.py` from the `src/gh/diffCheck/components` folder you are working on in `VSCode`, and set its path to the ScriptSync ghcomponent.
101103
4. If you modify the code in `VSCode`, the changes will be reflected in the Grasshopper component as soon as you save in `VSCode` again the `code.py`.
104+
5. Once your code is working, prepare the code and componentize it.
102105

103106
If you want to use the GHEditor it's ok but everytime you modify the pakcage or the component's code, after any modifications you need to restart the Python interpreter from the ScriptEditor (`Tools > Reload Python3 (CPython) Engine`) and recompute the solution in Grasshopper.
104107

108+
### B.3) Componentize the code
109+
Prepare your component as explained here. You can componentize it locally and test it in Grasshopper. Here's how to componentize:
110+
```terminal
111+
python f:\diffCheck\src\gh\util\componentizer_cpy.py --ghio "C:\Users\andre\.nuget\packages\grasshopper\8.2.23346.13001\lib\net48\" .\src\gh\components\ .\build\gh
112+
```
113+
> Note that you need to find the path to your GHIO folder. This is the folder where the `Grasshopper.dll` is located. E.g. You can find it in the `nuget` folder in the Rhino installation directory.
114+
115+
Once you are sure that the component is working correctly, you can push the changes to the repository.
116+
105117
## GHPy: C) Release
106118
The release will be made via CI from main. As a contributor you don't need to worry about this. The plug-in is componentized, pushed to yak/PyPI and the user can download the latest version from yak.
107119

0 commit comments

Comments
 (0)