Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Copying data container#335

Merged
mehdisadeghi merged 16 commits into
masterfrom
copying-data-container
Nov 2, 2016
Merged

Copying data container#335
mehdisadeghi merged 16 commits into
masterfrom
copying-data-container

Conversation

@stefanoborini

Copy link
Copy Markdown
Contributor

Performs copy of the data container at every interaction, as agreed with @mehdisadeghi

Comment thread scripts/generate.py Outdated
self.system_variables[key] = contents

elif isinstance(contents, dict) and 'default' in contents:
print("optional ", key)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

print

Comment thread scripts/generate.py Outdated
with make_temporary_directory() as temp_dir:

for key, class_data in yml_data['CUDS_KEYS'].items():
print("cuds keys ", key, class_data)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

print

@codecov-io

codecov-io commented Oct 24, 2016

Copy link
Copy Markdown

Current coverage is 93.69% (diff: 97.42%)

No coverage report found for master at 142bed7.

Powered by Codecov. Last update 142bed7...9a8e5b3

@stefanoborini stefanoborini changed the title Copying data container [WIP] Copying data container Oct 24, 2016
@stefanoborini

Copy link
Copy Markdown
Contributor Author

@mehdisadeghi ready for review

Comment thread scripts/generate.py Outdated
self._data = new_data
else:
self._data = DataContainer(new_data)''')
data = DataContainer.new_with_restricted_keys(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The keys shall remain flexible. All CUBA keys are accepted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Does this mean that the concept of supported keys is no longer valid?

@mehdisadeghi mehdisadeghi Oct 26, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is still valid. We want to leave it flexible, however. To the extent of CUBA keys.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What I mean is also the method supported_keys in the generated objects. If we don't restrict, what's the point of having that method?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is rendered useless. People used to like it. Deprecate it if you like.

Comment thread scripts/generate.py
for key, content in chain(
self.optional_user_defined.items(),
self.inherited_optional.items(),
):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see that this change in order has resulted in the changes in the generated init signatures. Is this intentional?
Just an observation: I suppose we cannot fix the signature such that future additional optional arguments would only be added at the end of a signature. Somewhere (in the doc maybe) the users should be advised to use named arguments when instantiating meta classes.

@stefanoborini

Copy link
Copy Markdown
Contributor Author

@kitchoi yes, it's intentional, because it was currently inconsistent.

@kitchoi

kitchoi commented Oct 25, 2016

Copy link
Copy Markdown
Contributor

@sbo Ok! Thanks.

@stefanoborini

Copy link
Copy Markdown
Contributor Author

We decided to copy everything, ignoring the supported parameters.

@stefanoborini

Copy link
Copy Markdown
Contributor Author

Also, see issue #341

@mehdisadeghi

Copy link
Copy Markdown
Contributor

Everything looks good to me!

@mehdisadeghi mehdisadeghi merged commit 2b6e5f7 into master Nov 2, 2016
@mehdisadeghi mehdisadeghi deleted the copying-data-container branch November 2, 2016 16:21
@mehdisadeghi

Copy link
Copy Markdown
Contributor

Related PR #326

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants