Using the DataClass
See original GitHub issueWe should be more about the data class.
from SimPEG import DC
dobs = DC.DCData.fromFile('myData.dat')
survey = dobs.survey
dobs.plotSection()
dobs.std[5] = notTrustWorthy
The Std should live with the data specifically (not the survey). The plotting functions for the data should be associated with the data class.
Issue Analytics
- State:
- Created 8 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
dataclasses — Data Classes — Python 3.11.1 documentation
The dataclass() decorator examines the class to find field s. A field is defined as a class variable that has a type annotation....
Read more >Data Classes in Python 3.7+ (Guide)
You can turn a dataclass into a dictionary with the dataclass.asdict function. Most python wrappers to data storage backends accept dictionaries. And when...
Read more >Understanding Python Dataclasses
DataClasses are like normal classes in Python, but they have some basic functions like instantiation, comparing, and printing the classes ...
Read more >using dataclass decorators in Python in custom classes
The dataclass decorator examines the class to find fields. A field is defined as class variable that has a type annotation. @dataclass class ......
Read more >Python dataclass
Python introduced the dataclass in version 3.7 (PEP 557). The dataclass allows you to define classes with less code and more functionality out...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the writeup @lheagy, very clear. Also thanks for the discussion in the Python channel in https://slack.simpeg.com with @fwkoch - always really interesting to see what magic we could do.
However, I really like the reduction of magic in this proposed implementation. I think the extra line that the user has to type ends up making the whole piece a lot more transparent.
Probably there would be some validation that looks to the
survey.num_data
to ensure that the arrays are the correct length!This will close with #786.