question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using the DataClass

See original GitHub issue

We 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:closed
  • Created 8 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
rowanc1commented, May 14, 2019

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!

0reactions
lheagycommented, May 2, 2020

This will close with #786.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found