-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GSoC 2016 Application Anchit Jain:Implement Public API for ERFA
Name Anchit Jain
Email anchitjain1234@gmail.com
Github anchitjain1234
IRC Nick anchitjain@freenode
Time Zone IST (UTC + 05:30)
GSOC Blog URL http://www.anchitja.in/blog/
Blog RSS feed http://www.anchitja.in/atom.xml/
University information
- University name : Birla Institute of Technology and Science Pilani
- Major : Computer Science, Economics
- Current Year : 4th
- Graduation Date : May 2017
- Degree : BE (Hons) Computer Science, MSc (Hons) Economics
I have submitted following patches to astropy
-
#4606 - Support for Path objects in
io
packages. -
#4561 - Remove new line characters after last row of data in
ascii.latex.AASTex
. - #4532 - Fix to generate zero-length copy of current table.
- #4482 - Displaying Compound model expressions when printing compound model instances.
-
#4474 - Fix for
CDS
reader requiring at least two description characters.
-
#4585 - Error handling in
io.fits.compression
module. - #4574 - Allow passing of tuples for setting constraints on model parameters.
-
#4551 - Explicitly set
BeautifulSoup
parser tohtml.parser
to avoid warning. -
#4505 - Fix for allowing
WCS
to take Image HDU.
-
Implement Public API for ERFA
-
Astropy currently uses wrapped version of ERFA library which covers some functions from original C library but not all.
If this wrapped library is extended to wrap all functions under ERFA and exposed as a public API, this would help astropy to leverage a validated and trusted library to do computational "heavy-lifting" which might also lead to performance improvements.
The two major aims of this project are- Create a separate package under
liberfa
which would be having 100% coverage for ERFA functions, good test coverage and documentation such that it follows all the guidelines forastropy
affiliated package. - Use the new package in astropy replacing
_erfa
and discuss for replacing overlapping code betweenastropy
python code and ERFA.
- Create a separate package under
-
- Working python based ERFA package wrapping original C based ERFA package, strictly adhering to
astropy
affiliated package guidelines. - Removal of
astropy._erfa
and use of this new python based ERFA package as external (but bundled) dependency.
- Working python based ERFA package wrapping original C based ERFA package, strictly adhering to
-
ERFA is Essential Routines for Fundamental Astronomy which implements high-quality astronomical routines in C.
Currently astropy uses ERFA incoordinates
andtime
subpackages for some angle utilities, conversions and time conversion, formatting by using_erfa
subpackage.
But it has been under discussion in community for a long time (#3123, #4571) to use ERFA as an external package inastropy
by exposing ERFA as public API. Recently (#4664) there has been also some discussion to whether replace python code in coordinates subpackage with ERFA code.
Therefore exposing ERFA as public API would be beneficial for Astropy and the larger scientific Python community.
I propose to do the following changes in two phases:-
Right now for ERFA functionality, astropy uses
_erfa
subpackage which wraps ERFA functions only from Astronomy section, AngleOps and SphericalCartesian subsections under VectorMatrix section.
In this phase I propose to increase wrapping and test coverage, improve function names and documentation.
I intend to do this in 3 subphases:-
- First I would start with Astropy affiliated package template and using the existing
_erfa
code in it, to create a new package possibly namedpyerfa
. Then I intend to extend it(wrapping) to all the remaining sections/subsections such that package could be imported as independent package, and all the ERFA functions would work without worrying about correctness of the results, just get every ERFA function working.- Currently functions under
CopyExtendExtract
underVectorMatrix
do give some weird error on wrapping. So my first task would be to parse functions underCopyExtendExtract
correctly. - Functions under other subsections were getting compiled correctly so next task would be to check that they are parsed correctly i.e. check if they do work and if not correct them.
- Existing
docstring
parser would need to be modified such that new parts to thedocstrings
could be added which are not present currently in original C library.
- Currently functions under
- First I would start with Astropy affiliated package template and using the existing
-
- In this subphase I intend to test rigorously all the new wrappings extended to ensure result correctness following Astropy guidelines for testing.
- This would involve testing the wrappings under different values of arguments and input types etc. using
py.test
module and following Astropy standard for testing. - Existing C test suite for ERFA (
t_erfa_c.c
) would be ported to Python by automatic conversion in the similar manner, by creating parsing templates for test suite and test suite generator. Parts which couldn’t be ported, would be hand-written. Through this approach we would be having exactly same test suite as of original SOFA/ERFA tests. - Overall objective would be to create a test suite having coverage >= 90%.
-
- In this subphase I would work on creating name aliases for the functions from ERFA as current names are very cryptic which don't suit well for code readability and understanding. For example.
eraAb
is a function in ERFA that performs aberration to transform natural direction into proper direction but this isn't very much clear from this name. Documentation improvement would go hand in hand with name aliasing - Name aliasing would involve manual work of checking code, work to be done by function, docs, arguments for function etc. and most importantly discussion with mentors to be done for every function.
- Documentation improvement would include updating of current
docstrings
generated by C comments to include examples followingdoctest
, short summary and other notes to follownumpy
styledocstrings
.
- In this subphase I would work on creating name aliases for the functions from ERFA as current names are very cryptic which don't suit well for code readability and understanding. For example.
-
-
Under this phase my focus would be on to use this newly generated package within Astropy.
I intend to do this in 2 subphases:-
- As
_erfa
would no longer be needed therefore update usages of_erfa
by the new package and get everything working - This would be done by creating new ERFA package as external dependency by placing it in
astropy/extern
and update its usages. Then_erfa
would be removed.
- As
-
- This subphase would involve discussion to whether replace python code with ERFA based on the results of performance analysis.
- Here first I would try to find parts of code where ERFA could be used, mainly in
coordinates
,time
etc. This would be done by carefully looking at the existing codebase to check whether ERFA function would suit here. - Then using performance analysis and discussion with mentors replace the code for the parts where agreement comes.
- Performance analysis would be done using
asv
by writing benchmarks first for existing code and then for code using ERFA.
-
-
Week | Work |
---|---|
Community bonding period (22 Apr - 22 May) | Check astropy._erfa and liberfa/erfa code closely, discuss concrete approach with mentors, read documentation for asv , cython . |
Week 1 (23 May - 29 May) |
|
Week 2 (30 May - 5 June) |
|
Week 3 (6 June - 12 June) |
|
Week 4 (13 June - 19 June) | Port original test suite(t_erfa_c.c ) to Python is similar manner (automated like wrapping). |
Week 5 (20 June - 26 June) |
|
Weeks 6-7 (27 June - 10 July) |
|
Week 8 (11 July - 17 July) |
|
Week 9 (18 July - 24 July ) | Check carefully astropy code, mainly in sections coordinates and time where existing python code could be replaced by ERFA function. |
Weeks 10-11 (25 July - 7 August) | Write benchmarks to evaluate performance of existing code and code after replacing with ERFA. |
Week 12-13 (8 August - 23 August) |
|
-
Do you have any other commitments during the main GSoC time period, May 23rd to August 23rd?
- My end semester examinations would be from 4 May - 15 May, so I would not be able to do much research then.
- My new semester would be starting from 1 August, this might decrease my productivity, but I would try my best to not let it affect me.
-
Have you applied with any other organizations?
No. I have just applied to Astropy. -
Have you participated previously in GSoC? when? with which project?
No. This is first time I am applying for GSoC.
Link to Resume http://www.anchitja.in/assets/resume.pdf/
Alternate contacts
- Email f2012570@pilani.bits-pilani.ac.in
- Facebook anchit.jain.1234
- Twitter : anchitjain1234