-
Notifications
You must be signed in to change notification settings - Fork 290
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
Code Reorganization Enhancement #446
Comments
Hi, Thanks for the input on this.
I agree that this is a good idea. Perhaps folders for all the different cw modules (io, adc, glitch, etc.) with files in them for each scopetype (husky_io.py, lite_io.py, etc.)? I do think it's easy to go too far here though - I personally find jumping between files to be a lot more jarring than jumping around a single file.
Yeah, extending similar classes is probably the "correct" way to do different hardware like this. The other methods are a little easier I think when adding the first parts of new functionality, which is probably why a lot of the CW code is structured like that. I think consistency is probably the best thing to aim for here. It also works better with how the documentation is setup currently. This might be best done by code similarity. For example, a lot of things on the Pro are just extensions of things on the Lite, so it makes sense to have those modules be extensions of the CWLite modules. Conversely, the Nano functions very differently from the Lite, so it probably makes sense for a lot of that to be completely separate classes. I'm not really sure if base classes make much sense with Python's duck typing. In a lot of languages, you can use it to define required functionality for a certain type of object (i.e. a scope object needs a We do have a training coming up (beginning of August), so we might also not look too much at it until that's over. Alex |
I also agree with the "too far" sentiment. I think it would be beneficial to breakout the different modules, as suggested, into their own files (GPIOSettings, TriggerSettings, etc), but from there, I have 2 ideas on how to organize HW implementations:
From my observations, most HW specific overrides/additions are small enough and few that a separate file isn't necessary so regardless of where these implementations are, it wouldn't add any significant bloat. I think I would personally go with option 2. Keeps the base class files clean and allows you to work with 1 file for the specific HW you are working on. |
Hi, Just wanted to let you know that we're back from Blackhat and I'll be going through your pull requests again. Thanks for your patience on this. |
Also to comment on your suggestion above: I'm not too sure what the best option is here. I'd kinda lean towards option 1, just because I don't find myself hopping between different modules too often. Either way would be a big organizational improvement through - just being able to go One suggestion I'd make is that CWNano stuff should go in its own file ( |
As I've been working on cleaning up and refactoring some of the API, I've noticed a couple of things that could be beneficial to the code base. I am open to input if any of this seems desirable!
Of course, I am offering to do this work! I'd work on it after I finish refactoring the current stuff I'm working on. Any thoughts?
The text was updated successfully, but these errors were encountered: