Conversation
…ve double points, to be corrected
… in Struct._checkformat_dgeom() and cleaner error handling in tf.geom._comp._Struct_set_Poly()
…ct not valid due to bug in _GG.Poly_isClockwise() inducing error on Vol in _GG.Poly_Order(), probably solved by lasofivec on another branch
…t 3 txt files still not loaded due to bug in _GG. tf.geom.utils.create_Config() more robust vs Struct that can't be loaded (warnings not fatal)
…nto Issue281_fork
[bf #331] raising exceptions when poly ill defined
Codecov Report
@@ Coverage Diff @@
## devel #333 +/- ##
==========================================
+ Coverage 40.02% 40.08% +0.05%
==========================================
Files 79 79
Lines 24128 24172 +44
==========================================
+ Hits 9658 9689 +31
- Misses 14470 14483 +13
Continue to review full report at Codecov.
|
|
|
||
| # Elimininate any double identical point | ||
| ind = np.sum(np.diff(Poly, axis=1) ** 2, axis=0) < 1.0e-12 | ||
| ind = np.sum(np.diff(np.concatenate((Poly, Poly[:, 0:1]), axis=1), |
There was a problem hiding this comment.
why do you close the poly ?
There was a problem hiding this comment.
We want a bool array ind the same shape as Poly, to tell us which successive points are redundant.
So:
- We use np.diff() => ind will be of shape (npts-), if poly has shape (2, npts). Concatenating the first poitn at the end (i.e. closing the polygon) will yield the good shape for ind
- If we don't close the poly here, and if the first point and the last point are identical (poly already closed), np.diff() will not detect it. So closing the poly in np.diff() is actually a good way of making sure we remove (at line 443) the last point if the poly was already closed
| lS.append(obj) | ||
| elif len(ff) > 1: | ||
| # More demanding criterion | ||
| ssbis, Expbis = '_'+ss+'.txt', '_Exp'+Exp+'_' |
There was a problem hiding this comment.
In this loop, cc is the class str ('PFC', 'Ves'...) and ss is the name of the Struct considered.
The name of a .txt file containing the polygon of a Struct is formatted as
TFG_class_ExpTokamak_Name.txt
For example:
TFG_PFC_ExpAUG_TPLT1.txt
This file contains the polygon for a PFC of experiment ASDEX Upgrade (AUG) which is called TPLT1.
There was a problem hiding this comment.
In this method we try to identify a unique txt fle corresponding to a given Struct (by class, Exp, name).
A first try is done with simple criteria which are sufficient 90% of the time.
But in some case multiple matches are found, because for example the names of several Struct share a common part, for example:
TFG_PFC_ExpAUG_D3BG1.txt
TFG_PFC_ExpAUG_D3BG10.txt
These are two different Struct. But the name of the first one is fully enclosed in the name of the second.
So if we look for all files containing the str 'D3BG1', we'll find these two solutions.
In that case, we search again with more strict criteria to identify the unique file.
|
Thanks for approving the merge :-) |
|
You can restore it when it is needed but you can also keep it on :) |
Main changes:
And AUG now appears in the available configs message created by PR #327
Perspectives:
Issues:
Acknowledgements:
A contribution obtained with the help of @jdhare