I am a senior freelance software engineer, with about 10 years' experience. I've been working in a university setting for the past year, as a contractor. Usually I work in a commercial environment.
During the year, I've done 15-20 days' work on each of 2 different projects that should have turned into papers, but didn't due to lack of time from the PI. These projects are more or less complete from a coding point of view: they just haven't been written up by the PI. I believe the time required to write up should be 2-4 days each.
I've now decided to move on from the team (partly due to frustration at projects like these being blocked, which means I don't have much visible output) and am documenting and handing over my projects.
My question is this. On these projects, is it reasonable to ask for authorship on any paper that is written based on my work after I leave? And - assuming that my estimate of 2-4 days' work remaining above is correct - is it reasonable to ask for first authorship? (Our field is epidemiology / life sciences, so I believe that authorship order reflects overall contribution.)
We weren't doing traditional scientific experiments - these are data-driven research projects. So the hierarchy is probably more like the wider digital world, in which execution is generally acknowledged to be more important than ideas. Specifically, my code would have collected the data; my coding decisions would have driven 95% of the design; and I would have written an iPython notebook forming the basis of the methods and results sections of the paper. The PI would write the intro and conclusions and pull together the paper. For example, one project was to do comparison of datasets in the scientific literature, and the PI's idea was pretty much "hey, let's look at dataset A, see if we could match it with dataset B, and draw some conclusions". My contribution was to see if that was possible, learn about datasets C and D and E and F, decide F was the best match, do the actual matching of A and F, and draw the conclusions. The PI will literally just write up the conclusions.
In both cases the original idea was the PI's, and they have provided guidance as I worked, but probably not more than 0.5-1 day in total.
I'm not sure how authorship works after I've left. The ICMJE's author definition says that authors should be involved in drafting and approving the paper, but I won't be involved in that (well, unless I work for free).
However, it's very important for my commercial reputation that I can point to visible work done during the year, so I would like to be named as an author, rather than all the work just vanishing under the PI's name.
One other point: the PI previously put me down as second author on a project where I'd done 99% of the work, and when I queried this, claimed there was no convention on authorship order in our field. Fortunately, I was able to resolve this amicably. But given that experience, I'm now keen to clarify the position about authorship before I leave, and I'd welcome advice on convention and etiquette in this situation.