-
Notifications
You must be signed in to change notification settings - Fork 133
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
Adding constrained sensing capabilities to the SPSL post processor. Added a test_SPSL_constrained xml for testing. #2346
base: devel
Are you sure you want to change the base?
Conversation
I believe this uses features in sparsesensing that are not yet in a released version, so besides any other work that needs to be done, this should not be merged until the sparsesensing release comes out. |
…9/raven into SPSL_add_constraints Need for testing
…whitespace changes to Sparsesensing.py
Job Test mac on d2dc13b : invalidated by @joshua-cogliati-inl failed in fetch |
Opps, actually failed in set python environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some comments for your consideration.
<Output class="DataObjects" type="DataSet">outPP</Output> | ||
</PostProcess> | ||
<IOStep name="print"> | ||
<Input class="DataObjects" type="DataSet">outPP</Input> | ||
<Input class="DataObjects" type="DataSet">outPP</Input>cd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is cd
a typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Thank you for catching that. I have removed cd.
goal.addSub(xValue) | ||
yValue = InputData.parameterInputFactory("yValue", contentType=InputTypes.StringListType, | ||
printPriority=108, | ||
descr=r"""Variable plotted on the Y-axis of the data model""") ##Do we want another Z-value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, do we want a zValue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! In case we have 3D data! Thank you for catching that!
printPriority=108, | ||
descr=r"""X coordinate of the focus of the parabola""") | ||
goal.addSub(a) | ||
xy_coords = InputData.parameterInputFactory("xy_coords", contentType=InputTypes.IntegerListType, ##What is the type for an array? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, some of the comments like "What is the type for an array?" look like they may be out of date.
self.sampleTag = 'RAVEN_sample_ID' # The sample tag | ||
self.center_x = None # The x co-ordinate of center of circle,ellipse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, it looks like this only supports one Constrained Region? I think PySensors supports multiple constrained regions?
## TODO: Add GQR for constrained optimization | ||
elif self.optimizer.lower() == 'gqr': | ||
optimizer = ps.optimizers.GQR() | ||
## TODO: Add CCQR for cost constrained optimization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do any of these TODO's need to be fixed?
@@ -0,0 +1,136 @@ | |||
<?xml version="1.0" ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file does not seem to be used in the tests yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like new tests have been added, so maybe this file can be removed?
<constraintOption>"exact_n"</constraintOption> | ||
<ConstrainedRegions type = "circle"> | ||
<center_x></center_x> #center coordinates instead (x,y) (r, \theta) | ||
<center_y></center_y> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments in xml are done using <!--your comment-->
center_x and center_y seems not to be recognized
image = 'classificationOptiTwist/mySensorPlot_scatter-scatter.png classificationOptiTwist/mySensorPlot3D_scatter.png' | ||
required_libraries = 'imageio' | ||
rel_err = 0.01 | ||
[../] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only review the image with a relative error of 0.01 which is too small for image comparison. We need to test the csv and the image. rel_err
for image can be 0.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a gold file? (Also for the other outPP.csv files)
@@ -52,10 +54,26 @@ class cls. | |||
printPriority=108, | |||
descr=r"""Features/inputs of the data model""") | |||
goal.addSub(features) | |||
target = InputData.parameterInputFactory("target", contentType=InputTypes.StringType, | |||
xValue = InputData.parameterInputFactory("xValue", contentType=InputTypes.StringListType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that changing the input usually requires an automated script be created and placed in scripts/conversionScripts/
printPriority=108, | ||
descr=r"""Variable plotted on the Y-axis of the data model""") | ||
goal.addSub(yValue) | ||
zValue = InputData.parameterInputFactory("yValue", contentType=InputTypes.StringListType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this "zValue" = ... "yValue"?
idxConstrained, rank = parabola.get_constraint_indices(all_sensors = allSensors, info=dataframe) | ||
elif self._ConstrainedRegionsType == 'Polygon': | ||
xyTuple = [(self.xCoords[i], self.yCoords[i]) for i in range(0, len(self.xCoords))] | ||
print(xyTuple) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print
probably should be commented out, or switched to a self.raiseADebug
Job Test Ubuntu 18 PIP on c06a2bb : invalidated by @joshua-cogliati-inl Cleaned up files on test machine. |
Job Mingw Test on 254895a : invalidated by @niharika2999 |
1 similar comment
Job Mingw Test on 254895a : invalidated by @niharika2999 |
…straintsCircleOptiTwist/.DS_Store Deleting unwanted files
…straintsCircleOptiTwist/mySensorPlot_scatter-scatter.png Deleting unwanted files
…straintsCircleOptiTwist/mySensorPlot3D_scatter.png Deleting unwanted files
…straintsCircleOptiTwist/outPP.csv Deleting unwanted files
…straintsCircleOptiTwist/.ravenStatus Deleting unwanted files
…straintsEllipseOptiTwist/.ravenStatus Deleting unwanted files
…straintsEllipseOptiTwist/mySensorPlot3D_scatter.png Deleting unwanted files
…straintsEllipseOptiTwist/mySensorPlot_scatter-scatter.png Deleting unwanted files
…straintsEllipseOptiTwist/outPP.csv Deleting unwanted files
|
||
<RunInfo> | ||
<WorkingDir>reconstructionConstraintsOptiTwist</WorkingDir> | ||
<Sequence>LoadCSV, mySPpp, print</Sequence> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@niharika2999 , the reason tests are failing is that the path is inconsistent. For instance, the working directory here is reconstructionConstraintsOptiTwistCircle
but in tests it is reconstructionOptiTwistConstraintsCircle. Hope this helps
…9/raven into SPSL_add_constraints
…straintsCircleOptiTwist directory Deleting wrongly named folders
…straintsEllipseOptiTwist directory Deleting wrongly named folders
…straintsLineOptiTwist directory Deleting wrongly named folders
…straintsParabolaOptiTwist directory Deleting wrongly named folders
…straintsPolygonOptiTwist directory Deleting wrongly named folders
Job Mingw Test on e3b6a09 : invalidated by @niharika2999 |
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
Closes #2347
What are the significant changes in functionality due to this change request?
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.
<internalParallel>
to True.raven/tests/framework/user_guide
andraven/docs/workshop
) have been changed, the associated documentation must be reviewed and assured the text matches the example.