-
Notifications
You must be signed in to change notification settings - Fork 1
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
DM-43905: Add (modelfit_)parameters to lsst_distrib #12
Conversation
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.
No major objections to the rename, but given my comments about namespaces and header paths on lsst/modelfit_parameters#11, I expect much of this PR will need to be redone. I've commented on a few other things that are iffy, but more in scope of DM-43906.
include/parameters.h
Outdated
@@ -40,7 +40,7 @@ struct SizeYParameter : public SizeParameter { | |||
}; | |||
|
|||
template <typename T> | |||
using Param = parameters::Parameter<double, T>; | |||
using Param = modelfit_parameters::Parameter<double, T>; |
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.
While it's not actually forbidden, are you intending to expose gauss2d::fit::Param<T>
as part of the library API? If not, I recommend dropping it and using explicit names for the base classes.
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 the concern that users might reference gauss2d::fit::Param
instead of modelfit_parameters::Parameter<double, T>
? But even for a CRTP base, this is a type alias and they'd be equivalent, no?
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.
No, the concern is that some other code that uses Param
and happens to include this file might suddenly (and surprisingly) get a collision. As you say, the namespace mitigates the risk, but it still seems iffy to expose names that aren't intended for use.
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.
Ok, my conclusion is that I'll renamed to Param
to ParameterD
in line with stack naming conventions (and current use in multiprofit). I suppose I could do this in modelfit_parameters
but slightly prefer to do it here and not impose that nomenclature on other hypothetical modelfit_parameters
users.
meson.build
Outdated
@@ -26,13 +26,13 @@ if use_eups | |||
include_directories: gauss2d_eupsdir + '/build-release/include', | |||
) | |||
|
|||
parameters_eupsdir = run_command('eups', 'list', '-d', 'parameters', check: true).stdout().strip() | |||
parameters_eupsdir = run_command('eups', 'list', '-d', 'modelfit_parameters', check: true).stdout().strip() |
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 don't think this will actually work in general -- eups list -d
lists all installed versions of a given package, regardless of tag. I'd recommend relying on MODELFIT_PARAMETERS_DIR
instead; I don't think there's any expectation that a package is buildable if it is not set up.
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.
Part of the reason I did it this way is that Meson is very opinionated about not providing access to environment variables. However, it turns you can use run_command('sh', '-c', '...')
and reference environment variables in the command, which I'm not happy about but seems to be the easiest solution at the moment.
The alternative is to write a (Python) eups module for Meson, which is possible but not nearly as trivial as I'd hope.
python/gauss2d/fit/parameters.h
Outdated
#include "parameters/transform.h" | ||
|
||
#include <modelfit_parameters/limits.h> | ||
#include <modelfit_parameters/transform.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.
In addition to my earlier comment about <>
, please include dependencies before local includes.
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.
You mean:
#include "lsst/modelfit/parameters.h"
#include "gauss2d/fit/parameters.h"
... separating them because the latter file is part of this package, though I still need to include it by the full namespace?
1bd43ba
to
ce5df2e
Compare
c9e6e62
to
4d68703
Compare
include/param_defs.h
Outdated
#include "parameters/parameter.h" | ||
#include "lsst/modelfit/parameters.h" | ||
|
||
namespace parameters = lsst::modelfit::parameters; |
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 cause any source file that (directly or indirectly) includes this header to define parameters
. Potential namespace collision if it's also using some other parameters?
include/sersicmixcomponent.h
Outdated
* @note See https://ned.ipac.caltech.edu/level5/March05/Graham/Graham2.html | ||
* for a useful summary of various properties of the Sersic profile. | ||
* (Graham & Driver 2005) for a useful summary of various properties | ||
* of the Sersic profile. |
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.
Prefer inline links:
* @note See https://ned.ipac.caltech.edu/level5/March05/Graham/Graham2.html | |
* for a useful summary of various properties of the Sersic profile. | |
* (Graham & Driver 2005) for a useful summary of various properties | |
* of the Sersic profile. | |
* @note See [Graham & Driver 2005](https://ned.ipac.caltech.edu/level5/March05/Graham/Graham2.html) | |
* for a useful summary of various properties | |
* of the Sersic profile. |
include/model.h
Outdated
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 future, please do clang-format
runs in a separate commit.
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 think I've finally managed to get clang-format on save working everywhere I need it, so hopefully that will obviate the need for manual runs.
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's auto-formatting that tends to be the problem, because reformats of unrelated code get mixed in with the written-as-formatted changes.
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.
Right, but there shouldn't be any unrelated changes once everything is formatted unless the format rules are changed or someone commits non-compliant changes, in which case sure, I'll do a separate format step first.
No description provided.