Skip to content

Commit

Permalink
remove the index from the spectral window
Browse files Browse the repository at this point in the history
there is no particular use for it, as any ordering should be handled by the underlying VO-DML tooling.

Also update to the latest tooling that has better composite handling
  • Loading branch information
pahjbo committed Nov 30, 2023
1 parent ceedacd commit eb5ae56
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
9 changes: 4 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo

plugins {
id("net.ivoa.vo-dml.vodmltools") version "0.4.0"
id("net.ivoa.vo-dml.vodmltools") version "0.4.1"
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
signing
}

group = "org.javastro.ivoa.dm"
version = "0.4.0-SNAPSHOT"
version = "0.4.1-SNAPSHOT"


vodml {
Expand Down Expand Up @@ -99,9 +99,8 @@ tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.INCLUDE } //IMPL b
dependencies {
api("org.javastro.ivoa.vo-dml:ivoa-base:1.1-SNAPSHOT")
// implementation("org.javastro:ivoa-entities:0.9.3-SNAPSHOT")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.1")

testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
implementation("org.slf4j:slf4j-api:1.7.32")
testRuntimeOnly("ch.qos.logback:logback-classic:1.2.3")

Expand Down
14 changes: 1 addition & 13 deletions src/main/vo-dml/proposaldm.vo-dml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<title>TBD</title>
<author>Paul Harrison</author>
<version>0.3</version>
<lastModified>2023-04-24T10:53:18Z</lastModified>
<lastModified>2023-11-28T09:40:15Z</lastModified>
<import>
<name>null</name><!--should not be needed in modern vo-dml -->
<url>IVOA-v1.0.vo-dml.xml</url>
Expand Down Expand Up @@ -1162,18 +1162,6 @@
<vodml-id>ScienceSpectralWindow</vodml-id>
<name>ScienceSpectralWindow</name>
<description>A spectral window for science use.</description>
<attribute>
<vodml-id>ScienceSpectralWindow.index</vodml-id>
<name>index</name>
<description></description>
<datatype>
<vodml-ref>ivoa:integer</vodml-ref>
</datatype>
<multiplicity>
<minOccurs>1</minOccurs>
<maxOccurs>1</maxOccurs>
</multiplicity>
</attribute>
<composition>
<vodml-id>ScienceSpectralWindow.spectralWindowSetup</vodml-id>
<name>spectralWindowSetup</name>
Expand Down
1 change: 0 additions & 1 deletion src/main/vodsl/proposaldm.vodsl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ observations, although the intention is that information about targets etc. coul

otype ScienceSpectralWindow "A spectral window for science use."
{
index: ivoa:integer "" ;
spectralWindowSetup: SpectralWindowSetup @? as composition "" ;
expectedSpectralLine: ExpectedSpectralLine @* as composition "" ;
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public EmerlinExample () {
});
g.spectrum = Arrays.asList(
createScienceSpectralWindow(ssw -> {
ssw.index = 1; //TODO is this of any use?
ssw.spectralWindowSetup = createSpectralWindowSetup(sw -> { // continuum
sw.start = new RealQuantity(1.2, ghz);
sw.end = new RealQuantity(1.7, ghz);
Expand All @@ -137,7 +136,6 @@ public EmerlinExample () {
}),

createScienceSpectralWindow(ssw -> { // narrow window for line
ssw.index = 2;
ssw.expectedSpectralLine = Arrays.asList(createExpectedSpectralLine(sl -> {
sl.restFrequency = new RealQuantity(1.4204058, ghz);
sl.description = "HI";
Expand Down
18 changes: 18 additions & 0 deletions src/test/java/org/ivoa/dm/proposal/prop/EmerlinExampleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ public void testObservations() {
assertNotNull(obs.target);
assertTrue(obs.target instanceof CelestialTarget);

}
@org.junit.jupiter.api.Test
public void testDeleteTarget() {
jakarta.persistence.EntityManager em = setupH2Db(ProposalModel.pu_name());
em.getTransaction().begin();
final ObservingProposal proposal = ex.getProposal();
proposal.persistRefs(em);
em.persist(proposal);
em.getTransaction().commit();
em.getTransaction().begin();
Observation obs = proposal.observations.get(0);
assertNotNull(obs.target);

assertTrue(obs.target instanceof CelestialTarget);
em.remove(obs.target);
em.getTransaction().commit();


}

@org.junit.jupiter.api.Test
Expand Down

0 comments on commit eb5ae56

Please sign in to comment.