From eb5ae568180704480d2e5c652eef2fc2e0d24a44 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Thu, 30 Nov 2023 08:51:27 +0000 Subject: [PATCH] remove the index from the spectral window 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 --- build.gradle.kts | 9 ++++----- src/main/vo-dml/proposaldm.vo-dml.xml | 14 +------------- src/main/vodsl/proposaldm.vodsl | 1 - .../ivoa/dm/proposal/prop/EmerlinExample.java | 2 -- .../dm/proposal/prop/EmerlinExampleTest.java | 18 ++++++++++++++++++ 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index df21643..da34792 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 { @@ -99,9 +99,8 @@ tasks.withType { 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") diff --git a/src/main/vo-dml/proposaldm.vo-dml.xml b/src/main/vo-dml/proposaldm.vo-dml.xml index 09d9d23..5dc1aa0 100644 --- a/src/main/vo-dml/proposaldm.vo-dml.xml +++ b/src/main/vo-dml/proposaldm.vo-dml.xml @@ -12,7 +12,7 @@ TBD Paul Harrison 0.3 - 2023-04-24T10:53:18Z + 2023-11-28T09:40:15Z null IVOA-v1.0.vo-dml.xml @@ -1162,18 +1162,6 @@ ScienceSpectralWindow ScienceSpectralWindow A spectral window for science use. - - ScienceSpectralWindow.index - index - - - ivoa:integer - - - 1 - 1 - - ScienceSpectralWindow.spectralWindowSetup spectralWindowSetup diff --git a/src/main/vodsl/proposaldm.vodsl b/src/main/vodsl/proposaldm.vodsl index 465a7a3..41f4841 100644 --- a/src/main/vodsl/proposaldm.vodsl +++ b/src/main/vodsl/proposaldm.vodsl @@ -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 "" ; } diff --git a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java index 6e850f1..b004086 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExample.java @@ -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); @@ -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"; diff --git a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExampleTest.java b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExampleTest.java index c32408c..c702091 100644 --- a/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExampleTest.java +++ b/src/test/java/org/ivoa/dm/proposal/prop/EmerlinExampleTest.java @@ -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