Skip to content

Conversation

@gselzer
Copy link
Member

@gselzer gselzer commented May 20, 2021

This PR introduces scijava-struct, a new module extracting the Struct/Member data structures from the present Ops module. Partitioning these data structures into their own module allows us to unify logic between SciJava Ops and KNIME (see scijava/scijava#58)

TODO:

@gselzer gselzer requested review from ctrueden and wiedenm May 20, 2021 22:07
@gselzer gselzer force-pushed the scijava/scijava-struct/init branch from 21b4d4e to dcc7df2 Compare May 21, 2021 16:03
@gselzer gselzer force-pushed the scijava/scijava-struct/init branch from dcc7df2 to bf2a68b Compare July 15, 2021 17:03
@gselzer gselzer force-pushed the scijava/scijava-struct/init branch from bf2a68b to d090c1c Compare August 5, 2021 15:11
@ctrueden ctrueden self-assigned this Nov 12, 2021
This commit removes the org.scijava.struct package, since it was moved
to its own module. scijava-ops now depends on scijava-struct
@ctrueden ctrueden force-pushed the scijava/scijava-struct/init branch 2 times, most recently from 04718c1 to f6df62f Compare November 19, 2021 17:31
Copy link
Member

@ctrueden ctrueden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this code together with Christian over many painstaking iterations at a hackathon, so it's not surprising that I'd be satisfied with it as is. But I am. Satisfied. 😆

<mailingLists>
<mailingList>
<name>Image.sc Forum</name>
<archive>https://forum.image.sc/tags/scijava-struct</archive>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be /tag/scijava.

</mailingLists>

<scm>
<connection>scm:git:git://github.com/scijava/incubator</connection>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be scm:git:https://github.com//scijava/incubator since GitHub stopped supporting git://.

</issueManagement>
<ciManagement>
<system>Travis CI</system>
<url>https://travis-ci.com/scijava/incubator</url>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to change to GitHub Actions.

import java.util.List;
import java.util.stream.Collectors;

public class DefaultStructInstance<C> implements StructInstance<C> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should definitely javadoc the struct stuff. Of course we need javadoc on all public API, but struct is super abstract and will be very helpful to have it documented for later.

* result.
*
* @see org.scijava.param.Mutable
* @see org.scijava.ops.function.Inplaces
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct does not depend on any scijava ops components, right? So this @see is not valid. It's great to point out that MUTABLE is relevant to inplace functions in ops, but I think we need to do it in a "non-type-safe" way, unfortunately.

* but whose content will be populated during execution of the operation.
*
* @see org.scijava.param.Container
* @see org.scijava.ops.function.Computers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This @see may not be valid; see below.

*
* @see Field#getGenericType()
*/
// TODO: Use Type<T> or Nil<T> from new scijava-types.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO is obsolete now, right? Or should this be Nil<T>?

default MemberInstance<T> createInstance(
@SuppressWarnings("unused") Object o)
{
return () -> Member.this;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My brain is probably not working today, but... what even is this syntax‽

Edit: OK, I get it... it's (mostly) equivalent to:

Member<T> me = this; return new MemberInstance<T>() { @Override Member<T> member() { return me; } }

but in slick lambda shorthand.

@ctrueden ctrueden merged commit b3e5b73 into main Nov 19, 2021
@ctrueden ctrueden deleted the scijava/scijava-struct/init branch November 19, 2021 18:14
@ctrueden ctrueden removed their assignment Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

3 participants