[Git][java-team/libbeam-java][upstream] New upstream version 1.3.9
Andrius Merkys (@merkys)
gitlab at salsa.debian.org
Fri Apr 4 10:00:45 BST 2025
Andrius Merkys pushed to branch upstream at Debian Java Maintainers / libbeam-java
Commits:
cc21f578 by Andrius Merkys at 2025-04-04T02:06:04-04:00
New upstream version 1.3.9
- - - - -
7 changed files:
- core/pom.xml
- core/src/main/java/uk/ac/ebi/beam/Parser.java
- core/src/main/java/uk/ac/ebi/beam/Topology.java
- core/src/test/java/uk/ac/ebi/beam/GraphTest.java
- exec/pom.xml
- func/pom.xml
- pom.xml
Changes:
=====================================
core/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<artifactId>beam</artifactId>
<groupId>uk.ac.ebi.beam</groupId>
- <version>1.3.8</version>
+ <version>1.3.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>
=====================================
core/src/main/java/uk/ac/ebi/beam/Parser.java
=====================================
@@ -29,7 +29,16 @@
package uk.ac.ebi.beam;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.BitSet;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
import static java.util.Map.Entry;
@@ -65,7 +74,7 @@ final class Parser {
* Local arrangement for ring openings.
*/
private Map<Integer, LocalArrangement> arrangement
- = new HashMap<Integer, LocalArrangement>(5);
+ = new HashMap<Integer, LocalArrangement>(8);
private Map<Integer, Configuration> configurations
= new HashMap<Integer, Configuration>(5);
@@ -352,16 +361,12 @@ final class Parser {
List<Edge> begEdges = new ArrayList<>(getLocalEdges(beg));
if (begh)
begEdges.add(start.contains(beg) ? 0 : 1, null);
- for (Edge bEdge : getLocalEdges(beg)) {
+ for (Edge bEdge : begEdges) {
if (bEdge == null) {
carriers[i++] = beg;
continue;
}
int bnbr = bEdge.other(beg);
- if (beg < bnbr && begh) {
- carriers[i++] = beg;
- begh = false;
- }
if (bEdge.bond() == Bond.DOUBLE) {
// neighbors next to end
List<Edge> endEdges = new ArrayList<>(getLocalEdges(end));
=====================================
core/src/main/java/uk/ac/ebi/beam/Topology.java
=====================================
@@ -164,20 +164,23 @@ abstract class Topology {
* @param rank rank of vertices
* @return sorted array (cpy of vs)
*/
- static int[] sort(int[] vs, int[] rank) {
- int[] ws = Arrays.copyOf(vs, vs.length);
-
+ static void sort(int[] vs, int[] rank, int beg, int end) {
// insertion sort using rank for the ordering
- for (int i = 0, j = i; i < vs.length - 1; j = ++i) {
- int v = ws[i + 1];
- while (rank[v] < rank[ws[j]]) {
- ws[j + 1] = ws[j];
+ for (int i = beg, j = i; i < end - 1; j = ++i) {
+ int v = vs[i + 1];
+ while (rank[v] < rank[vs[j]]) {
+ vs[j + 1] = vs[j];
if (--j < 0)
break;
}
- ws[j + 1] = v;
+ vs[j + 1] = v;
}
- return ws;
+ }
+
+ static int[] sort(int[] vs, int[] rank) {
+ int[] cpy = Arrays.copyOf(vs, vs.length);
+ sort(cpy, rank, 0, vs.length);
+ return cpy;
}
/**
@@ -221,7 +224,6 @@ abstract class Topology {
+ "invalid extended tetrahedral configuration");
int p = configuration.shorthand() == CLOCKWISE ? 1 : -1;
-
return new ExtendedTetrahedral(u,
Arrays.copyOf(vs, vs.length),
p);
@@ -529,9 +531,15 @@ abstract class Topology {
/** @inheritDoc */
@Override Topology orderBy(int[] rank) {
- return new ExtendedTetrahedral(u,
- sort(vs, rank),
- p * parity4(vs, rank));
+ int[] cpy = Arrays.copyOf(vs, vs.length);
+ sort(cpy, rank, 0, 2);
+ sort(cpy, rank, 2, 4);
+ int p2 = p;
+ if (rank[vs[1]] < rank[vs[0]])
+ p2 *= -1;
+ if (rank[vs[3]] < rank[vs[2]])
+ p2 *= -1;
+ return new ExtendedTetrahedral(u, cpy, p2);
}
/** @inheritDoc */
=====================================
core/src/test/java/uk/ac/ebi/beam/GraphTest.java
=====================================
@@ -569,5 +569,10 @@ public class GraphTest {
CoreMatchers.is("CCCO[PH]1(OC[C@@H]2[C@@H](O1)[C@@]([C@@H](O2)n3cnc4c3nc(nc4OCC)N)(C)F)O"));
}
-
+ @Test public void alleneWindingWithRingClosures() throws IOException {
+ Assert.assertEquals("C(=[C@]=CBr)F",
+ Graph.fromSmiles("C1=[C@]=CBr.F1").toSmiles());
+ Assert.assertEquals("FC=[C@@]=CBr",
+ Graph.fromSmiles("F1.C1=[C@]=CBr").toSmiles());
+ }
}
=====================================
exec/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<artifactId>beam</artifactId>
<groupId>uk.ac.ebi.beam</groupId>
- <version>1.3.8</version>
+ <version>1.3.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>
=====================================
func/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<artifactId>beam</artifactId>
<groupId>uk.ac.ebi.beam</groupId>
- <version>1.3.8</version>
+ <version>1.3.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>
=====================================
pom.xml
=====================================
@@ -7,7 +7,7 @@
<description>SMILES parsing and generation library for cheminformatics</description>
<url>http://www.github.com/johnmay/beam/</url>
<packaging>pom</packaging>
- <version>1.3.8</version>
+ <version>1.3.9</version>
<modules>
<module>core</module>
<module>func</module>
View it on GitLab: https://salsa.debian.org/java-team/libbeam-java/-/commit/cc21f578396511c91c3526f9ccdbfdf6b4aa43fd
--
View it on GitLab: https://salsa.debian.org/java-team/libbeam-java/-/commit/cc21f578396511c91c3526f9ccdbfdf6b4aa43fd
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20250404/3e9f4c9c/attachment.htm>
More information about the pkg-java-commits
mailing list