Skip to content

Commit

Permalink
Merge pull request #269 from vincentcasseau/dev
Browse files Browse the repository at this point in the history
Docs: updating docs - dev is the default branch and must be selected …
  • Loading branch information
vincentcasseau authored Jan 29, 2025
2 parents 5bc0297 + 9158a7d commit cdd92dc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 29 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cassiopee 4
# Cassiopee

**C**omputational **F**luid **D**ynamics pre- and post-processing python modules.
Computational Fluid Dynamics pre- and post-processing python modules.

-- Under construction --

Expand All @@ -19,4 +19,4 @@

- [On windows](https://github.com/onera/Cassiopee/blob/main/docs/developers/Install/msys2.md)

- [On linux ubuntu](https://github.com/onera/Cassiopee/blob/main/docs/developers/Install/ubuntu.md)
- [On linux ubuntu](https://github.com/onera/Cassiopee/blob/main/docs/developers/Install/ubuntu.md)
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ git config --global user.email <[email protected]>
Change directory to where you'd like the Cassiopee Github repository to be and type:

```sh
git clone [email protected]:onera/Cassiopee.git
git clone --branch main --single-branch [email protected]:onera/Cassiopee.git
```

2. To contribute to the Github repository instead, please consider creating a fork first: on the [github repo](https://github.com/onera/Cassiopee), click on the _Fork_ button followed by _Create new fork_. Then, you can clone the `main` branch of your Fork as:
2. To contribute to the Github repository instead, please consider creating a fork first: on the [github repo](https://github.com/onera/Cassiopee), click on the _Fork_ button followed by _Create new fork_. Then, you can clone the `dev` branch of your Fork as:

```sh
git clone [email protected]:<github_username>/Cassiopee.git
Expand All @@ -56,7 +56,7 @@ The next time you will want to synchronise your fork from the command line, plea

```sh
git status # make sure you have no local changes
git pull upstream main
git pull upstream dev
git push
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To contribute, you need to create a `Pull Request` from your remote fork webpage

<br> </br>

## Synchronising your fork from the upstream repository
## Synchronising your fork from the dev branch of the upstream repository

- From your remote fork webpage (https://github.com/github_username/Cassiopee/), click on the _Sync fork_ button

Expand Down Expand Up @@ -45,11 +45,11 @@ git stash pop stash@{stash_id} # combine git stash apply and git stash drop in

<br> </br>

## Synchronising your fork's local and working directories from your remote fork
## Synchronising your local and working directories from your remote fork

To synchronise your local directory only:
```sh
git fetch origin main
git fetch origin dev
```

To synchronise your working directory from your local directory:
Expand All @@ -59,7 +59,16 @@ git merge

To synchronise both directories at once:
```sh
git pull origin main
git pull origin dev
```

<br> </br>

## Synchronising your local and working directories, and your remote fork, from the upstream repo

```sh
git pull upstream dev
git push origin dev
```

<br> </br>
Expand Down Expand Up @@ -118,5 +127,5 @@ git push

## Submitting changes to the upstream repository

Finally, to propose your modifications to the upstream/official repository, you have to
Finally, to propose your modifications to the `dev` branch of the upstream/official repository, you have to
create a Pull Request. Go to the webpage of your remote fork: https://github.com/github_username/Cassiopee/, click on the _Contribute_ button and follow the instructions (give a title to your PR, describe the modifications and review your changes).
33 changes: 15 additions & 18 deletions docs/developers/guide4devs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,36 @@ Editor:
-------
- indent with spaces (2 or 4 depending on file complexity). Dont use tabs.
- use utf8/lf encoding
- respect typo for commas: t1, t2, a3.
- respect type for two points: a:
- respect typo for commas: `t1, t2, a3`.
- respect type for two points: `a:`

Python Functions:
-----------------
- no snake (my_function) in function names or arguments. Use Camel (myFunction).
- short comment string in function header
- function must have a test before commit
- in place function starts with _ and return None
- internal functions ends with __
- function must have a copyRef counter part that calls in place function
- in place function starts with `_` and return None
- internal functions ends with `__`
- function must have a copyRef counterpart that calls in place function
- no IO in function (must work on input t and return t or a copy of t)
- try to unify argument names with existing functions
- complexifying an existing function, adding argument or modifying argument sense must be discussed
- check that function performs correctly on FlowSolutionNodes, FlowSolution#Centers, ZoneBC and ZoneGridConnectivity
- if the function is fully operational, write doc
- always pass full global validCassiopee before commit


- complexifying an existing function, ie adding an argument or modifying the meaning of an argument, must be discussed
- check that a function performs correctly on `FlowSolutionNodes`, `FlowSolution#Centers`, `ZoneBC` and `ZoneGridConnectivity`
- if a function is fully operational, write the doc
- always run validCassiopee in full against the global test database before commit

Tests:
------
- no snake in test file name.
- first line of test shoud be # - functionName (pyTree) -
- first line of test shoud be `# - functionName (pyTree) -`
- seq tests finishes by _t1, _t2.
- parallel test finishes by _m1, _m2 and are run on 2 procs.
- in tests, dont use input files, create the test case in the script.
- a test must run in less than 10 seconds (ideally 1 sec).

OpenMP:
-------
- when a computationaly intensive loops exist, if the treatment is independant, you must use
omp for parallelisation. For example :
- for computationally intensive loops, use omp parallelisation wherever possible. For example:

```c
#pragma omp parallel
Expand All @@ -54,9 +51,9 @@ omp for parallelisation. For example :
}
```

- the pragma omp parallel creates threads and as a slight cost.
- the pragma omp for only split the for loop into equal pieces
- for more complex creation, you can access the thread id like this:
- the `pragma omp parallel` clause creates threads and has a slight cost: group `pragma omp for` clauses within its scope if possible.
- the `pragma omp for` clause splits the for loop into equal chunks
- in more complex cases, you can get the thread id and number of threads as:

```c
#pragma omp parallel
Expand All @@ -65,4 +62,4 @@ omp for parallelisation. For example :
E_Int numThreads = __NUMTHREADS__;
/* ... */
}
```
```

0 comments on commit cdd92dc

Please sign in to comment.