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

GUI does not work with current TARDIS version #690

Closed
unoebauer opened this issue Jan 13, 2017 · 16 comments
Closed

GUI does not work with current TARDIS version #690

unoebauer opened this issue Jan 13, 2017 · 16 comments

Comments

@unoebauer
Copy link
Contributor

unoebauer commented Jan 13, 2017

Since the GUI was originally designed to work with a model object but since TARDIS now returns a simulation object, it can't start but crashes with the following Error message:


In [3]: mdl =  tardis.run_tardis(config)

In [4]: interface.show(mdl)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-8332875ec95a> in <module>()
----> 1 interface.show(mdl)

/home/ulrich/miniconda2/envs/tardis/lib/python2.7/site-packages/tardis_sn-1.5.dev2668-py2.7-linux-x86_64.egg/tardis/gui/interface.pyc in show(model)
     41     tablemodel = SimpleTableModel
     42     win = Tardis(tablemodel)
---> 43     win.show_model(model)
     44 
     45     if importFailed:

/home/ulrich/miniconda2/envs/tardis/lib/python2.7/site-packages/tardis_sn-1.5.dev2668-py2.7-linux-x86_64.egg/tardis/gui/widgets.pyc in show_model(self, model)
   1159         """
   1160         if model:
-> 1161             self.mdv.change_model(model)
   1162         if model.converged:
   1163             self.successLabel.setText('<font color="green">converged</font>')

/home/ulrich/miniconda2/envs/tardis/lib/python2.7/site-packages/tardis_sn-1.5.dev2668-py2.7-linux-x86_64.egg/tardis/gui/widgets.pyc in change_model(self, model)
    567         self.model = model
    568         self.tablemodel.arraydata = []
--> 569         self.tablemodel.add_data(model.t_rad.value.tolist())
    570         self.tablemodel.add_data(model.ws.tolist())
    571 

AttributeError: 'Simulation' object has no attribute 't_rad'

Note: this is a GSoC 2017 project related issue

@vedantrathore
Copy link

@unoebauer I would like to work on this, could you give me a few pointers to start with

@wkerzendorf
Copy link
Member

@vedantrathore I would suggest you stick to one topic and move to a new one - once you have solved it.

@vedantrathore
Copy link

Ok sure @wkerzendorf

@deep110
Copy link

deep110 commented Jan 13, 2017

@wkerzendorf @unoebauer I have submitted a PR #691 on this issue. Can you look into it.

@pfreddy
Copy link
Contributor

pfreddy commented Jun 13, 2017

I would like to ask if there has been any progress made in this issue?
The synthetic line identification of GUI would be crucial for my next study. Is there any other way to receive these information from a TARDIS model?

@yeganer
Copy link
Contributor

yeganer commented Jun 20, 2017

Sorry to be late to the party. The information is still available but might be stored at different locations now.

I'm not familiar with the GUI, so I can't help you there. I haven't tested PR #691 but from the conversation it looks like the result is working and there were only some issues with the naming convention preventing a merge into master.
Therefore you could try to merge that PR locally and test if it works.
git checkout upstream/master; git pull upstream pull/691/head

If you have more specific questions or this approach did not work, feel free to ask away :)

@pfreddy
Copy link
Contributor

pfreddy commented Jun 20, 2017

@yeganer Thanks for the reply! I changed the two lines mentioned in PR #691 and the error message about the unknown 't_rad' parameter disappeared! Now I get an other error message about 'iterations_max_requested' (according the comment of @deep110 in PR #691). After fixing that, I got a third one.
I continue this in PR #691.

@yeganer
Copy link
Contributor

yeganer commented Jun 21, 2017

@pfreddy Let's continue this here. I believe #691 was done by a GSoC applicant and won't be continued.

As I wrote in #691, I'm busy right now and won't have the time to fix the GUI myself. However I can help you fix it if you have questions as I'm very familiar with the code and the data structures.
Essentially what we did with our refactoring last summer was to split the old model into several classes.
The main instance is now a Simulation object which contains a model (contains the physical structure, temperature and abundances), the plasma (contains the atomdata and everything related to the plasma) and the runner (contains everything related to the Monte Carlo simulation, that means the estimators and implementation details like time_of_simulation).

After looking at the code I noticed that model.tardis_config is used quite often. This is not possible anymore as we currently do not store the configuration past the initialization step. However, most of the configuration values can be found in the three main data classes.
For some values the gui is using it might be required to provide dummy values or find clever ways to obtain said value as the internal structure of tardis changed and these values might not be available anymore. One example might be current_no_of_packets which does not exist anymore but one could check the shape of simulation.runner._output_nu to get that value.

That's it for now, if you have specific questions, especially where to find some data in the restructured model, feel free to ask here or in our gitter.

@pfreddy
Copy link
Contributor

pfreddy commented Jun 21, 2017

@yeganer Thanks for the detailed description!
I hoped that there might be an easy way to solve for the GUI problem, but this is not the case. The solution is not urgent, at least, I will need the line info of my synthetic spectra for a paper in 3-4 weeks.

@unoebauer
Copy link
Contributor Author

@pfreddy - to get detailed information about specific line features, you don't necessarily need the GUI. All the information can be extracted interactively from the simulation object in an ipython session with a bit of boolean logic and re-indexing. You may want to have a look at the tardis_kromer_plot.py script in the tardisanalysis repository. It analyses the last packet interactions.

@yeganer
Copy link
Contributor

yeganer commented Jun 27, 2017

@unoebauer @pfreddy You should have a look at #720

@pfreddy
Copy link
Contributor

pfreddy commented Jul 5, 2017

@unoebauer @yeganer Almost works, but the information about the last interactions still unavailable. The traceback is copied to #720.

@pfreddy
Copy link
Contributor

pfreddy commented Jul 5, 2017

@unoebauer I also checked the tardis_kromer_plot.py scipt. It might be a dumb question, but how/where should "compile Tardis" with the '' --with-vpacket-logging '' flag?

@unoebauer
Copy link
Contributor Author

@pfreddy - this is only necessary, if you want to diagnose the virtual packet spectrum. You are interested in stuff like:

  • mdl.runner.last_line_interaction_in_id
  • mdl.runner.last_line_interaction_out_id

which you then use to query the line list mdl.plasma.atomic_data.lines. Here, mdl stands for the simulation object run_tardis returns.

BTW: - the with-vpacket-logging flag would be used when building tardis, i.e.

./setup.py build install --with-vpacket-logging.

@pfreddy
Copy link
Contributor

pfreddy commented Jul 11, 2017

@unoebauer Great, this is something I can use. Thank you!

Although, there is an other issue about GUI. I reinstalled the whole TARDIS with anaconda, but the recommended pyside package cannot be found (conda install pyside=1.2.1). It seems like to me that PyQt4 is no longer available with conda. However, interface.py and widgets.py do not work with PyQt5 - right? I tried to apply qt5 and rewrite the *.py files, but still without result.

@ssim
Copy link
Contributor

ssim commented Jul 14, 2017

If #765 merged, this can likely be closed.

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

No branches or pull requests

7 participants