-
Notifications
You must be signed in to change notification settings - Fork 18
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
Implementation of Spectroscopy File Readers #130
Comments
For Renishaw
Both formats can also be read by Gwyddion: http://gwyddion.net/module-list-nocss.en.php#spcfile |
No, registering IO is not implemented. There is a PR to split the IO hyperspy/hyperspy#2174. I agree that it would be good to implement IO plugin registration feature. |
If I have a look at the discussion, the intention seems to vary between providing a generic scientific reader package with @hakonanes & @dnjohnstone, I have seen that |
All readers in kikuchipy are independent of HyperSpy. But we mirror HyperSpy's API with The choice to not include the plugins (started in 2019) in HyperSpy was made because (1) I wanted the readers to return a kikuchipy |
The ideas being a single separate library are:
|
Similar to kikuchipy, I would favor keeping the readers in LumiSpy for the moment. Though mirroring the API seems like the easier, but subideal solution to me. Instead, I think having the extension mechanism for IO would be great (and probably would be needed after the split so that people can keep using |
OK, I'll resurrect hyperspy/hyperspy#2174. I submitted the draft to RnM, but actually, since it doesn't touch the API at all, I could well resubmitted it to Rnm, isn't it? Due to popular demand, I will implement a plugin system like the extensions one. I imagine the following structure: HyperSpy import all IO plugins from RosettaSCIO. RosettaSCIO itself just provides light machinery to register IO plugins in other repositories. Those could be standalone IO libraries (e.g. RosettaEMIO) or more general packages (e.g. LumiSpy). What do you think? |
Sounds fair. An alternative route could be to develop the plugin/extension system in a separate PR to Rnm and in a second step include it in the split. |
My impression is that plugins or entry points is not right solution here and this is the wrong direction of travel, as this would facilitate dispersion of efforts. For example, in the case of There were reasons/blockers in the past to have plugins in
Since then, there have been very good progress to address these issue and now, we do have reasons to get all io reader/writer in an independent library. Here I am trying to elaborate more on the reasons which have discussed here and elsewhere:
There is some degree subjectivity/speculation in some of the points above but based on my experience, I think there are fair. Indeed of scattering the reader/I would suggest that we do the following:
The only thing that we need to be careful with this approach is that we don't break the hyperspy API when splitting the IO part, until hyperspy 2.0 and there are solutions for this issue, either a IO shim in hyperspy or work with two development branch in the IO library, one with the API frozen and the other with the new API. I think that points 1 to 3 can be done quickly and importantly this would provide a good platform for future development, for example, by starting to improve to metadata situation or by developing the new API of the IO library independently from any other libraries. |
In principle, I am happy with either solution - just we need to know where to start the development of the new readers. Just a few points that come to my mind:
|
I think that the approach suggested above is ready to go, can be done quickly and simply needs a push. @francisco-dlp, does it sound like a fair statement?
For users, the size of library (as in file size to download) will not be large if we don't package the test data and use pooch to download test data when running the test suite. For contributors, I would expect that it would be more simpler/streamline as most reader should be fairly standalone and we would not have to deal with the IO parsing mechanism in hyperspy, which make thing a bit opaque at first or for new contributor. Basically, splitting it should also lower the barrier for contributing in comparison to contributing to hyperspy.
Yes, agreed. Another side of the coin is that several people have implemented readers elsewhere, which were already present in hyperspy because they are not interested to use hyperspy or they have other reasons. This is what I have been told several time in person and I am sure that I am not the only one to have told this! |
OK, so I guess the way forward for us would be to start implementing the new readers in a local branch of HyperSpy (instead of directly in LumiSpy) and then hopefully the basic split will be in time so that we can migrate the code to the new repo and do a PR there. |
If you need it to start now or very soon, yes, this is what I would do: start in the branch of a hyperspy fork and once the IO library repository is created, move the code to a fork of the IO library repo (from a quick google search, it should be possible to keep the history if necessary). @francisco-dlp would know better about that and would be best to confirm it, as he started the split in hyperspy/hyperspy#2174! :) |
Yes, we are planning to start in the next few weeks. |
I have restarted working on #2174. I will resubmit a working prototype next week and create a new repository for rosettascio where you could submit your new readers. I agree with @ericpre in that a single IO library is better in most respects than having readers scattered around multiple libraries and packages. However, HyperSpy is increasingly used beyond EM, so, while it'll be good to have all the EM readers in the same repository, I don't think that it is feasible to get readers from disparate scientific communities in the same library. Therefore, it seems to me that we should also offer a plugin system so that other communities can plug their IO libraries into HyperSpy. |
@jlaehne I just wanted to add to this discussion that this is the way I personally approached the new I/O reader for the Attolight files (before @LMSC-NTappy wrote the full version). Working on your own branch in the main HyperSpy is a good compromise, and you can also create a lumispy install tag in |
With RosettaSciIO now split from HyperSpy, the new readers can now be contributed there. |
Describe the functionality you would like to see.
We want to provide readers for different luminescence spectroscopy file formats. In particular,
.xml
) - see Add reader for Jobin-yvon .xml-format hyperspy/rosettasciio#25.tvf
) - see Add reader for Trivista .tvf format hyperspy/rosettasciio#27.wdf
) - see Add reader for renishaw .wdf format hyperspy/rosettasciio#55.spc
)Describe the context
Is it already possible to register file reader extensions with HyperSpy @ericpre and @francisco-dlp? As these are not electron microscopy related file formats, I would propose to have them within LumiSpy - but it would be great to register them so that they work with
hs.load
similar to how we extend HyperSpy by additional signal types.Additional information
@pietsjoh would work on the implementation of the readers
The text was updated successfully, but these errors were encountered: