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

Restructure plotframes.py #59

Closed
armengau opened this issue Jan 8, 2021 · 4 comments
Closed

Restructure plotframes.py #59

armengau opened this issue Jan 8, 2021 · 4 comments

Comments

@armengau
Copy link
Collaborator

armengau commented Jan 8, 2021

@weaverba137 I'd like now to restructure essentially the plotframes.py code in a new branch. On the other hand plotspecutils is largely redundant with plotframes. Does it make sense to fully merge both or do you want to keep them separate?
What do you think of the following:

  1. Maybe first merge plotspecutils with plotframes? Looking at their diff, it looks easy. Maybe also find a different name: in the end, external users or scripts use eg "from prospect import MODULE" then "MODULE.plotspectra()".
    Well, for this first step I'm not sure what to do.

  2. Create few classes, one file/class, containing the main data in plotframes.plotspectra(). Once this is done, plotframes.plotspectra() should have a reasonable nb of code lines. Suggested classes, with the associated most important data:

  • class ProspectCDS:
    cds_spectra
    cds_model
    cds_targetinfo
  • class ProspectPlotSet:
    fig
    data_lines
    noise_lines
    model_lines
    zoomfig
    imfig
    emission/absorption lines (should be renamed)
  • class ProspectWidgetSet:
    ifiberslider (could we rename it to ispectrumslider ?)
    smootherslider
    prev/next_button
    several z widgets
    target info display
    several VI widgets (may be an independent class)
  1. Move remaining functions in plotframes.py to separate files (eg one file for emission/abs line functions).
    I don't know what to do with the main. I would remove it entirely (there's no main in plotspecutils).

  2. Remove unused functions in utilities.py

Originally posted by @armengau in #49 (comment)

@weaverba137
Copy link
Member

Reopening an issue basically means that the original issue was not fixed or that a code regression has caused a bug to reappear. In #49, a lot of it was fixed, and it is more appropriate to open individual issues on each of the remaining tasks. In fact, this issue itself could have been factored into 4 separate issues.

I will start by taking a look at the diff between plotframes.py and plotspecutils.py.

@armengau
Copy link
Collaborator Author

The main restructure was done in #67.

I still leave this open until utilities.py is cleaned.

@weaverba137
Copy link
Member

@armengau, Presumably this was fixed by #73?

@armengau
Copy link
Collaborator Author

Fixed by #73

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

No branches or pull requests

2 participants