def from_jd(jd):
year = gregorian.from_jd(jd)[<NUM_LIT:0>]<EOL>day = jwday(jd) + <NUM_LIT:1><EOL>dayofyear = ordinal.from_jd(jd)[<NUM_LIT:1>]<EOL>week = trunc((dayofyear - day + <NUM_LIT:10>) / <NUM_LIT:7>)<EOL>if week < <NUM_LIT:1>:<EOL><INDENT>week = weeks_per_year(year - <NUM_LIT:1>)<EOL>year = year - <NUM_LIT:1><EOL><DEDENT>elif week == <NUM_LIT> and weeks_per_year(year) != <NUM_LIT>:<EOL><INDENT>week = <NUM_LIT:1><EOL>year = year + <NUM_LIT:1><EOL><DEDENT>return year, week, day<EOL>
Return tuple of ISO (year, week, day) for Julian day