pymad / cpymad

cPyMAD is a python interface to Mad-X using cython and libmadx
http://cern.ch/pymad
Apache License 2.0
3 stars 3 forks source link

Custom model pathes #15

Closed coldfix closed 11 years ago

coldfix commented 11 years ago

Hey, I have performed some minor changes, so models can be loaded from any path - not just from the install path of pymad, like this:

# search models also in 'models' subdirectory of current directory:
cpymad.listModels.modelpathes.append(os.path.join('.', 'models'))

It seems to be working fine. On the other hand, I don't know for what pkgutil.get_data and pkg_resources.resource_string were used in cern.cpymad.model._get_file_content() - so there might be a bit of an redundancy or inconsistency now.

Tell me what you think about this.

Best regards, Thomas

Eothred commented 11 years ago

That sounds like a good idea, thank you for the suggestion! I will take some time to review it to see how it fits into the structure, but generally I like it.