You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,20 +88,32 @@ That's it you are now a contributor to the diffCheck! We raccomand to not downlo
88
88
89
89
## GHPy: B) development/debug
90
90
91
-
### Code structure
91
+
### B.1) Code structure
92
92
For DiffCheck there are 2 main folders in the repository:
93
93
*`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
94
94
*`src/gh/diffCheck/diffCheck` this is our package where the core functionalities are implemented.
95
95
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
+
97
99
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:
98
100
1. Install the `ScriptSync` extension for `VSCode`.
99
101
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.
101
103
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.
102
105
103
106
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.
104
107
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:
> 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
+
105
117
## GHPy: C) Release
106
118
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.
0 commit comments