{"action":"created","issue":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/1832","repository_url":"https://api.github.com/repos/hyperspy/hyperspy","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/1832/labels{/name}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/1832/comments","events_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/1832/events","html_url":"https://github.com/hyperspy/hyperspy/pull/1832","id":296641555,"number":1832,"title":"Document HyperSpy extensions","user":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars0.githubusercontent.com/u/989719?v=4","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"labels":[{"id":103360281,"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/affects:%20documentation","name":"affects: documentation","color":"eb6420","default":false},{"id":410127191,"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/release:%20next%20patch","name":"release: next patch","color":"5319e7","default":false},{"id":166577586,"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/status:%20needs%20review","name":"status: needs review","color":"fbca04","default":false},{"id":171605271,"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/type:%20New%20feature","name":"type: New feature","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-02-13T07:46:43Z","updated_at":"2018-02-28T15:21:38Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1832","html_url":"https://github.com/hyperspy/hyperspy/pull/1832","diff_url":"https://github.com/hyperspy/hyperspy/pull/1832.diff","patch_url":"https://github.com/hyperspy/hyperspy/pull/1832.patch"},"body":"Add a new \"HyperSpy extensions\" section to the Introduction chapter of the User Guide."},"comment":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/comments/369272959","html_url":"https://github.com/hyperspy/hyperspy/pull/1832#issuecomment-369272959","issue_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/1832","id":369272959,"user":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars0.githubusercontent.com/u/989719?v=4","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"created_at":"2018-02-28T15:21:38Z","updated_at":"2018-02-28T15:21:38Z","author_association":"OWNER","body":"In your example ``IndexationGenerator`` seems to be a class that is initialised with an indexation library and a signal instance. I think that following HyperSpy's current conventions, this feature could have been implemented as a ``Signal method``  instead. For example, instead of:\r\n\r\n```python\r\nindexer = IndexationGenerator(dp,library)\r\n```\r\nthis\r\n```python\r\nindexer = dp.indexation_generator(library)\r\n```\r\nbecause in HyperSpy the convention is to only use functions for operations that take several signals as inputs such a ``stack``. Have you tried this? If yes, why didn't it work well for you?\r\n\r\nSticking to current HyperSpy's conventions (or changing them if needed) has the advantage that users dealing with multiple \"extensions\" can easily get the structure of all of them because it is common. One of the goals of the extensions concept for HyperSpy itself is to encourage the development of more packages extending HyperSpy currently available objects without directly contributing to HyperSpy itself. If this happens, better common conventions should emerge from interacting with a broader community and stretching HyperSpy usage beyond its current limits.\r\n\r\nAssuming that a given package extends hyperspy and, in addition, adds objects that don't fit (and cannot fit) in HyperSpy's structure, a possibility could be splitting it in two: a package that extends and another one that simply uses those features internally. Of course another alternative is to create a monolithic package instead and not even mention that the package extends HyperSpy in any way. However, I don't think that this good practice because that package, if installed, will inject objects into HyperSpy itself that will be available even when not importing the package.\r\n\r\nTo avoid confusion, packages that use HyperSpy internally (such as HyperSpyUI) are not concerned by this discussion/PR. This is just a discussion about how to add the feature to HyperSpy to register external objects as first class citizens (so that, e.g. a new external signal is properly loaded from file for example). This has nothing to do with encouraging/discouraging packages that build on top of HyperSpy (vs extending it), nor has anything to do with any \"overarching hyperspy dogma\" other than developing and promoting conventions for the benefit of the developers and users concerned."}}
{"actor":{"display_login":"francisco-dlp"}}