-
Notifications
You must be signed in to change notification settings - Fork 4
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
missing dependency on pyyaml #10
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,3 +105,17 @@ def secured_getattr(self, key): | |
else: | ||
return func(self, key) | ||
return secured_getattr | ||
|
||
|
||
@nicedeco | ||
def init_before(mtd): | ||
""" | ||
Decorator for methods: call method self._actual_init() | ||
before actually calling method if not self.initialized. | ||
""" | ||
def initialized(self, *args, **kwargs): | ||
if not self._initialized: | ||
self._actual_init() | ||
return mtd(self, *args, **kwargs) | ||
return initialized | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ce décorateur est-t-il utilisé pour des méthodes de classes définies dans bronx? J'ai du mal à comprendre le besoin d'utiliser une autre fonction d'initialisation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. L'idée c'est de faire une "delayed init", en n'initialisant certaines choses (typiquement, lire un fichier de définitions GRIB) que lorsqu'on en a réellement besoin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Du coup
matplotlib
aussi non?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De manière optionnelle oui. Mais tout code qui ferait appel à bronx pour ces fonctions matplotlib utiliserait déjà matplotlib, donc c'est moins indispensable.
Pour pyyaml c'est simplement qu'un
from bronx.datagrip.misc import read_dict_in_CSV
dans epygram lève une
ModuleNotFoundError: No module named 'yaml'