Skip to content
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

Added DLL Path Argument #74

Closed
wants to merge 1 commit into from
Closed

Conversation

bemcdonnell
Copy link
Member

Very simple adjustment to the Simulation class so we can point to custom DLLs

@bemcdonnell bemcdonnell added this to the v0.4 milestone Mar 9, 2017
@bemcdonnell bemcdonnell self-assigned this Mar 9, 2017
@michaeltryby
Copy link
Contributor

The dll path should be handled for the programmer by the pyswmm object. The user of the simulation object shouldn't have to worry about it. Separation of concerns. If the programmer wants to point to a custom dll perhaps there is a better way.

One idea would be to instantiate the pyswmm object with the path to the dll and then pass it to the Simulation constructor. So you would make the pyswmm object as argument of the simulation constructor instead of the dll path. Make sense?

I think this is a better solution, but I'm sure there are even better ones I may not be aware of.

@bemcdonnell
Copy link
Member Author

@michaeltryby, there is a default path that is handled "behind the scenes." But if the user wants to specify their own version of the dll, this is an option. In the module PySWMM, the user already has the option to point to their DLL of choice. within Simulation object, I wanted to extend that capability

@michaeltryby
Copy link
Contributor

@bemcdonnell I understand that and I don't think it should be done that way. Responsibility for the dll path should be contained within the pyswmm object. My suggested solution accomplishes that.

@bemcdonnell
Copy link
Member Author

@michaeltryby, that's a fair point...

@goanpeca, what do you think?

@michaeltryby
Copy link
Contributor

@bemcdonnell @goanpeca Just brainstorming .... You could make the pyswmm object "smarter" about managing the dll path. For example, designate a location for alternate dlls and have the pyswmm object look there.

A python wrapper pointing at a dll is standard stuff. I'm sure this has been solved really well by someone else.

@goanpeca
Copy link
Contributor

goanpeca commented Mar 9, 2017

I don't like the idea of having a dll_path. This should be handled automatically.

@bemcdonnell
Copy link
Member Author

bemcdonnell commented Mar 9, 2017 via email

@michaeltryby
Copy link
Contributor

This is a fine feature to add. What we are saying is "Lets think about how we do this." How we implement this matters. If 99/100 users won't use this then by definition it should not be a function argument.

@bemcdonnell Based on how you are using this, I think a better solution would be for the pyswmm object to automatically scan the working directory for an alternate dll and if one isn't found revert to the dll installed with the pyswmm package in site_packages. Make sense?

This is a win, win solution. You get the functionality you want, the dll path is managed, and the concern about dll path stays separated from the Simulation object because it doesn't belong there.

@bemcdonnell
Copy link
Member Author

We should come back to this. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants