-
Notifications
You must be signed in to change notification settings - Fork 27
Add description on activity types, parameters and resources in mission models #1714
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
base: develop
Are you sure you want to change the base?
Changes from all commits
0f419c1
827c2de
4d28316
e95fd10
fef4e2c
4aa0964
c729c54
7208a29
46ca4e2
5e46dab
ef08844
edab4f1
e6ce4b2
329e332
7730a84
1098e76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
alter table merlin.activity_type | ||
drop column description; | ||
alter table merlin.resource_type | ||
drop column description; | ||
|
||
call migrations.mark_migration_rolled_back(28); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
alter table merlin.activity_type | ||
add column description text default null; | ||
comment on column merlin.activity_type.description is e'' | ||
'The description of this activity type.'; | ||
|
||
alter table merlin.resource_type | ||
add column description text default null; | ||
comment on column merlin.resource_type.description is e'' | ||
'The description of this resource type.'; | ||
|
||
call migrations.mark_migration_applied(28); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
import gov.nasa.jpl.aerie.merlin.framework.annotations.ActivityType; | ||
import gov.nasa.jpl.aerie.merlin.framework.annotations.ActivityType.EffectModel; | ||
import gov.nasa.jpl.aerie.merlin.framework.annotations.AutoValueMapper; | ||
import gov.nasa.jpl.aerie.merlin.framework.annotations.Description; | ||
import gov.nasa.jpl.aerie.merlin.framework.annotations.Export.Parameter; | ||
import gov.nasa.jpl.aerie.merlin.framework.annotations.Export.Validation; | ||
import gov.nasa.jpl.aerie.merlin.framework.annotations.Subsystem; | ||
|
@@ -20,9 +21,10 @@ | |
*/ | ||
@ActivityType("BiteBanana") | ||
@Subsystem("Eat") | ||
@Description("Takes a bite out of the banana") | ||
public final class BiteBananaActivity { | ||
@Parameter | ||
|
||
@Description("The size of the bite in meters") | ||
@Banannotation("Specifies the size of bite to take") | ||
Comment on lines
+27
to
28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the difference between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @description is an Aerie supported annotation; @Banannotation is a model specific custom annotation. They both hold the same kind of data (a description of the parameter), just created in two different ways. I can move one to a different parameter to avoid having both on the same field if that’s clearer. |
||
@Unit("m") | ||
public double biteSize = 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.
Not disagreeing with the design, but why was
null
chosen to represent a lack of description as opposed to a) Optional.empty() or b) the empty string?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 went with null because it keeps resource registration simple since you only have to pass a string instead of wrapping it in an optional.of() every time you want to add a description on a resource. I could change it to use an empty string instead if that is preferable!