-
Notifications
You must be signed in to change notification settings - Fork 1
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
General Naming Conventions and Typing #3
Comments
Please use confined dataclasses (https://docs.python.org/3/library/dataclasses.html) for the meta data. Here is a proposal: from dataclasses import dataclass
from typing import Any, Literal
StrainUnit = Literal["m/m", "cm/m", "nm/m"]
@dataclass
class DASMeta:
version: int
data_unit: StrainUnit
start_time: float
sampling_period: float
gauge_length: float
latitudes: list[float]
longitudes: list[float]
elevations: list[float]
additional_data: dict[str, Any]
def endtime(self, nsamples) -> float:
... |
I chose readability over efficiency. I envision this as reference reader, not optimum super-duper high-class reader. It should help people understand the data format. But I am open for arguments against such approach |
regarding variable names, I am just lazy typing :-) Let's see what the community thinks |
My preference is definitely on writing out the variable names using underscores to include spaces. This can avoid a lot of misunderstandings and makes it possible to discover the structure of the data even when documentation is not available (lost, or forgotten). I think one aim of the project was indeed to create a discoverable format. |
@andreas-wuestefeld, if we are looking for a sustainable DAS data format we need an elaborate concept. Conceptualization of a data format is nothing for students or beginner programmers. We need performant I/O (layout) and efficient storage (compression).
A sustainable data format should be super-duper efficient and versatile!
A user does not need to understand a data format. All its complexity has to be abstracted away by a reference library. This is why e.g. ObsPy ( The fundamental question is whether we are looking for a serious DAS data format implemented by IRIS which can be used for
or a HDF5 structure for project-internal exchange in February. |
@miili I learned yesterday evening, in response to publishing this format, that IRIS is actually working on / considering a format I thus changed the potentially misleading name from IRIS (as part of the IRIS RCN efforts) to more general miniDAS. The repro name is still the same but will be hopefully fixed over the weekend. At this point, I feel it is most important to have a common format for the global month, ideal or not. Maybe you can just point out the most easy-to-fix issues here to be implemented (space vs time for example?). variable names can obviously also be adjusted |
implemented. |
I'm a month late to these discussions. I agree with @andreas-wuestefeld that the formal object-oriented structure is going to be a bit harder for many of us academics to deal with; I also had to wrap my head around how to work with it. That said I agree with @miili that it could be OK, in that most academics & students don't need to worry about the internals! We just need some very user friendly demos before February. Maybe Jupyter Notebooks? Not just a README list of headers and function inputs/outputs, but a full step-by-step guide showing how to load some interrogator's raw output (Silixa, Febus, whatever), declare the metadata object, use the from_numpy() function to eventually save the proper output, etc. |
Hello all,
first off, thank you for this first draft.
I know, I know, Fortran once had a limitation of 6 chars for any variable.
Please consider using clear self-explaining variables:
The text was updated successfully, but these errors were encountered: