Closed wtbarnes closed 7 years ago
Well, i just have to take your word for this as I have not looked very deeply into the structure of the Astropy package. What I saw did look complicated. ChiantiPy does have its own set of constants so I am a bit reluctant to change that.
My reason for putting ChiantiPy on github was to, as you say, to preserve its longevity and encourage future development. In that respect, I am very grateful for your help.
Right now I spend a lot of time fixed bugs, some of which I have recently inserted. Also trying to work on the CHIANTI database and figure out git/github. Haven't figured out how to make a release on github yet.
So, if you could propose a step by step approach to making an acceptable package for astropy/sunpy, that would be great. Needless to say, I will probably need help.
I've not created a release myself via GitHub, but it seems that they have some pretty nice tools for doing just this.
Part of the reason I began looking into the Astropy tools is that they provide a lot of Sphinx helper functions for creating nice documentation with little effort. For example, one can easily document an entire module using .. automodapi:: package.module
. Doing so in vanilla Sphinx requires considerably more effort.
One nice example where Astropy could extend the functionality of ChiantiPy is through the use of Astropy tables. For example, the ASCII table produced by fe14.intensityList(wvlRange=[200,220], index=10)
could be rendered instead as an Astropy table which shows up as a formatted html table in a Jupyter notebook and can be optionally printed as an AASTeX deluxetable.
I'm happy to help as much as possible with the integration of these features.
I've begun some work implementing the Astropy package template into ChiantiPy. I'll create a pull request to show the changes I've made and outline what I've done so far as a possible step-by-step approach.
thanks for all your help. I will take a look at this asap but I am busy today. but it looks reasonable
Copying over this checklist from merged PR #12
An incomplete list of TODOs in order to make ChiantiPy an Astropy affiliated package.
First, I would like to bring my fork up to compatibility with the main copy. I had made some important edits in some of the files and I think it is good for me to be familiar with the recent changes.
The doc string step look good, but as I said, I think it is necessary to wait a bit for me to catch up.
Astropy units will require a lot of thinking and work.
As for the rest of the step, they look logical but I am unfamiliar with most of them. I have heard of tests/testing but that is about it
Good idea. Better to get your branch even with the main master
branch before any other big changes. I didn't mean to rush anything with this checklist. I just wanted to copy it over from the old PR because I thought it more relevant to this issue.
This is of course just a rough outline of possible improvements. Others might have better/more detailed ideas. In general, I think SunPy and Astropy are good examples for documentation, packaging, testing, etc.
I'd like to mention that it might be more appropriate for ChiantiPy to become a SunPy affiliated package 👍
Is there an official checklist for SunPy affiliation like there is with Astropy? Or is it essentially the same?
Affiliation with SunPy appears to be easier to do. I does not mention anything about changing physical units. The units that ChiantiPy uses are largely compatible with various solar spectroscopic and broadband instruments.
@kdere the physical units used are not as much of a problem. It would be nice if the inputs and outputs were Astropy Quantity objects.
I have just brought my fork up to the point where it looks pretty much like the upstream master. So, I created a pull request and it came back that the pull request had a number of incompatibilities that had to sort out. I looked at file changes and the file .gitignore. There were about 8 red lines at the top which I assume are incompatible. However, these lines are neither in my fork or the upstream-master so I am confused! Any suggestions
Perhaps try just copying the .gitignore
from the upstream (i.e. chianti-atomic/ChiantiPy
) into your fork and see if that helps
that is what I did. maybe when I looked at the file edits, The top looks like the astropy .gitignore although not like the SunPy version. I copied an awful lot of files from the upstream, using the zip file you can download. I thought it would be easiest if everything looked alike. I will look into this some more.
OK, I just did an upstream pull and I will try to get things sorted. io.py is different because I deleted
import sys as sys is no longer used. will see what the rest consist of.
things are sorted out for now
I would suggest reopening this issue and keeping it open until either a) most of the steps for Astropy/SunPy affiliation have been completed or b) the decision is made to not have affiliation with either.
OK, did thtat
is there a way to install astropy as a Python 3 package?
Astropy is compatible with Python 2.7, 3.3, 3.4, and 3.5. From what I understand, there is one codebase and it is compatible with all four versions.
So if you're using Python 3 on your machine, it' just a matter of installing it with conda
or pip
. For example, to create a new Python 3 environment in conda and install astropy,
$ conda create --name my_new_astropy_env python=3
$ conda install astropy
This should probably be changed to "Make ChiantiPy a SunPy Affiliated package." Details regarding that are here.
It would probably be a good idea to move long term goals like this one to a roadmap in the wiki or something like that...
Closing this as I've moved this issue to a project idea in the wiki as part of an effort to transition longstanding/large scope issues and feature requests to the wiki.
Astropy provides a fairly straightforward template for building Astropy-like Python packages. SunPy currently uses a version of this template.
They provide bootstrapping for package setup and a lot of helpers for building documentation with Sphinx.
Another big advantage is Astropy's units system as well as the many constants that are builtin.
I think standardizing things like the docs and setup will help to preserve the longevity of ChiantiPy as well as encourage future development of the project. Incorporating it into the Astropy family will also make integration with SunPy easier. This will become important as the solar physics community (hopefully) becomes more Python-centric.