-
Notifications
You must be signed in to change notification settings - Fork 124
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
First commit for Dictionary #948
base: dev
Are you sure you want to change the base?
Conversation
Code corrected for format, lint code and warnings checking |
1e6ac8d
to
51db9f0
Compare
Can you please sync to resolve conflicts? Thanks! |
51db9f0
to
2abf2b1
Compare
Branch rebased on ttk-dev and conflicts resolved (the numerical loss returned may change a little bit) |
…gramDictionary Module
Correcting PersistenceDiagramClustering/PDBarycenter.cpp line 346 for Error in Check-Code and Check-Build |
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.
hi keanu,
thanks a lot for this PR!
here's a first batch of comments.
- essentially, they are mostly about naming conventions (for variables and functions, some clever sed -- i.e. find/replace -- should do)
- a few clarifications regarding Eigen
- some unnecessary headers to remove
- so signal creation to remove
- comments to remove, etc.
feel free to ping me on slack if you need more info!
thanks :)
ConstrainedGradientDescent.h | ||
DEPENDS | ||
common | ||
persistenceDiagram |
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 you need this?
if so, the name of the class may have to be changed.
(if it is specialized for persistence diagrams, the name of the class should reflect it).
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.
maybe you'd need to rename it into something like PersistentDiagramConstrainedOptimization
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.
or, you make this class more general (and not specialized to persistence diagram). to discuss I guess.
namespace ttk { | ||
using Matrix = std::vector<std::vector<double>>; | ||
|
||
class InitDictPersistenceDiagram : public Debug { |
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.
I find the name of the class not very explicit.
Words are usually not abbreviated in TTK.
I'd suggest to change the name of the class (and the related files) to something like PersistenceDiagramDictionaryInitializer
(PersistenceDictionaryInitializer
)
common | ||
persistenceDiagram | ||
persistenceDiagramClustering | ||
persistenceDiagramDistanceMatrix |
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.
are all these entries needed? (it's easy to try, just remove these lines and see if it sill works).
I have the impression that the dictionary already depend on the distanceMatrix, so I wonder if these lines are really needed. To try.
std::vector<std::vector<std::array<double, 2>>> &pairToAddGradList, | ||
ttk::DiagramType &infoToAdd); | ||
|
||
void setStep(double factEquiv); |
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.
-> double &factEquiv
(also in the implementation of the function).
use &
by default
std::vector<std::vector<std::array<double, 2>>> &pairToAddGradList, | ||
ttk::DiagramType &infoToAdd); | ||
|
||
double stepAtom; |
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.
-> stepAtom_
for member variables (i.e. member of a class), the convention in ttk is to put an extra _
at the end of the name (to quickly differentiate those from local variables, defined only within functions)
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.
(... except in the specific case of variables directly manipulated by VTK getters and setters)
#include <vtkDoubleArray.h> | ||
#include <vtkFiltersCoreModule.h> | ||
#include <vtkFloatArray.h> | ||
#include <vtkIntArray.h> |
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.
that include does not seem necessary.
please remove all unnecessary includes (i.e. delete the line and see if it still builds)
double Percent_{0}; | ||
|
||
public: | ||
// enum class BACKEND{BORDER_INIT = 0 , RANDOM_INIT = 1 , FIRST_DIAGS = 2}; |
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.
remove comment if not needed
/// \author Pierre Guillou <[email protected]> | ||
/// \date Mai 2023 | ||
/// | ||
/// \brief TTK processing package for the computation of a Dictionary |
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.
include proper class description.
|
||
int FillOutputPortInformation(int port, vtkInformation *info) override; | ||
|
||
void outputDiagrams(vtkMultiBlockDataSet *output, |
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.
in the VTK layer, the function names should probably match VTK's naming convention (GetOutputDiagrams()
)
const double spacing, | ||
const double maxPersistence) const; | ||
|
||
double getMaxPersistence(const ttk::DiagramType &diagram) const; |
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.
in the VTK layer, the function names should probably match VTK's naming convention (cf above), plus, make the function name more explicit.
hi keanu,
also, some undesired debug messages are still visible in the command line:
Thanks for fixing these (tiny) issues. |
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's a few extra comments after running your state file.
thanks!
|
||
|
||
<!-- Create a UI group that contains all output parameter widgets (here only one) --> | ||
<PropertyGroup panel_widget="Line" label="Input Options"> |
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.
These are more "Output Options"
|
||
<!-- Create a UI group that contains all output parameter widgets (here only one) --> | ||
<PropertyGroup panel_widget="Line" label="Input Options"> | ||
<Property name="AtomNumber_" /> |
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.
Thanks for listing all the other options here too.
Also:
- please organize and group them by theme
- make the labeling convention more uniform (the first word only starts with a capital)
- remove testing options
- make the labels more explicit
- extend the option documentation (
<Documentation>...</Documentation>
)
<!-- A string parameter that controls the name of the output array --> | ||
|
||
|
||
<!-- Create a UI group that contains all output parameter widgets (here only one) --> |
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.
please add a category "Output Options" (like for the PersistenceDiagramDictionary filter)
|
||
<!-- Create a UI group that contains all output parameter widgets (here only one) --> | ||
|
||
|
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.
Does this filter (at least in principle) depends on some of the parameter values set up during encoding?
(for instance to control the size of the barycenters)
If so, these parameter values should be encoded as field data (and read during decoding)
Thanks for contributing to TTK!
Before submitting your pull request, please:
Review our Contributor Guidelines, in particular regarding code formatting (with clang-format) and continuous integration.
Please provide a quick description of your contributions below:
Your description here