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

kalasiris.Path interface? #2

Open
rbeyer opened this issue Feb 22, 2019 · 1 comment
Open

kalasiris.Path interface? #2

rbeyer opened this issue Feb 22, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@rbeyer
Copy link
Owner

rbeyer commented Feb 22, 2019

Could we implement an object-oriented system where the kalasiris.Path object is subclassed from
pathlib.Path, so you can say:

    import kalasiris as isis
    
    h = isis.Path('some.img')
    
    h.hi2isis().hical()
    
    print h.name
    # prints 'some.cub' which is has been run through hical. 
    # Needs some careful thought about how to deal with the actual
    # filesystem files, which may be swapped around.
    
    # inspect with 
    h.qview()
    
    # Also overload operators with isis.algebra, so that
    one = isis.Path('one.cub')
    two = isis.Path('two.cub')
    
    three = one + two
    # is the same as
    isis.algebra(from_=one, from2=two, operator='add', to=?)
    # hmm, how to specify three.name, i.e. the to= cube?  Default to one.name?

Definitely needs some thinking.

@rbeyer rbeyer added the enhancement New feature or request label Feb 26, 2019
@michaelaye
Copy link
Contributor

i really like the algebra idea of this, even so, I think I have never done algebra with ISIS cubes.

For the first part this reminds me a bit of my PathManager object that keeps track of the different calibration states of ISIS cubes:

Screen Shot 2020-04-16 at 22 36 41

Maybe these ideas are combinable... more thinking...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants