Skip to content
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

Fix implicitly bound resources to be able to reference MultiVector #18

Merged
merged 5 commits into from
Feb 12, 2018

Conversation

VeaaC
Copy link
Collaborator

@VeaaC VeaaC commented Feb 4, 2018

Fixes #17

@CLAassistant
Copy link

CLAassistant commented Feb 4, 2018

CLA assistant check
All committers have signed the CLA.

@VeaaC VeaaC requested a review from boxdot February 4, 2018 13:20
@boxdot
Copy link
Collaborator

boxdot commented Feb 4, 2018

Looks good. I still would like @imagovrn to take a look.

@boxdot boxdot requested review from imagovrn and removed request for boxdot February 4, 2018 18:46
Copy link
Contributor

@imagovrn imagovrn left a comment

Choose a reason for hiding this comment

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

Implicitly binding with Multivector was never intended. Multivector is an associative data structure, not a sequence. Implicitly binding two sequences is well defined, whereas interpreting multivectors' index can be done in many ways (it could, for instance, store all the items to support constant time lookup or just some of them - for binary search). So I'd say we shouldn't do it without thinking it over again.
Makes sense, after talking about it.

Please have a look at two comments in the code.

@@ -15,9 +15,9 @@ def create(properties, own_schema):
own_schema=own_schema)

def _create_references(self):
return [VectorReference(name=r) for r in self._resources]
return [ResourceReference(name=r) for r in self._resources]
Copy link
Contributor

Choose a reason for hiding this comment

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

I would not add ResourceReference here as it incldues raw_data and we surely can't implicitly bind to raw_data. How about adding SequentialResourceReference or something like that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking about that, and my reasoning was like this:

  • RAW means the user manages the data
  • The user might store data in RAW that use indexed
  • The user might want to indicate in the schema that their RAW data is implicitly bound (however they manage their RAW data)

No strong opinions in that direction, but that seemed like a reasonable thing to allow (we do not benefit from being restrictive, do we?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a small note: Right now, we already allow to create explicit references from vectors into raw data.

@@ -136,7 +136,7 @@ def test_duplicate_multivector_builtin_types_are_not_produced():
@bound_implicitly( b: A0.v0, A0.v1 )
archive A0 {
v0 : vector< S1 >;
v1 : vector< S1 >;
v1 : multivector< 14, S1 >;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add, not replace. Better - add another test. This one will check for vectors. Another - for multivectors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is not a test for vector. This tree is named TREE_WITH_ALL_FEATURES

@VeaaC VeaaC merged commit 0b4d10f into heremaps:master Feb 12, 2018
@VeaaC VeaaC deleted the fix_implicit_bound_for_multivector branch June 19, 2018 07:44
gferon pushed a commit to gferon/flatdata that referenced this pull request Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants