[pycalcal] push by enrico.spinielli - some text for alt-az. Unit tests at end of parts. on 2009-12-28 16:43 GMT

6 views
Skip to first unread message

pyca...@googlecode.com

unread,
Dec 28, 2009, 11:44:18 AM12/28/09
to pyca...@googlegroups.com
Revision: d23185980e
Author: Enrico Spinielli <enrico.s...@gmail.com>
Date: Mon Dec 28 08:43:41 2009
Log: some text for alt-az. Unit tests at end of parts.
http://code.google.com/p/pycalcal/source/detail?r=d23185980e

Modified:
/pycalcal.bib
/pycalcal.nw

=======================================
--- /pycalcal.bib Sat Oct 24 10:58:23 2009
+++ /pycalcal.bib Mon Dec 28 08:43:41 2009
@@ -21,7 +21,9 @@
title = {Calendrical Calculations},
publisher = {Cambridge University Press},
year = {2008},
- edition = {Third}
+ edition = {Third},
+ note = {Common Lisp code available at
+
\url{http://www.cup.cam.ac.uk/resources/0521702380/5106_calendrica-3.0.cl.zip}}
}

@Book{aho:awk,
=======================================
--- /pycalcal.nw Sun Dec 27 09:32:53 2009
+++ /pycalcal.nw Mon Dec 28 08:43:41 2009
@@ -70,7 +70,7 @@
% drop down initial letter
\usepackage{lettrine}

-\usepackage{appendix}
+%\usepackage{appendix}


% figures template
@@ -79,7 +79,7 @@
%% \begin{center}\framebox{Fee Foe Fi Fum \ldots}\end{center}
%% \caption{A very nice figure indeed}\label{very-nice-figure}
%% \rule{\textwidth}{0.005in}
-%% \end{figure}
+%% \end{figure}

@@ -99,7 +99,7 @@
Prof.~Reingold for his his prompt reply to all my questions.
Finally my gratitude goes to my parents, Alida and Mario, for the
sacrifice they endevoured in order to allow me get inspired by
- Science.}
+ Science.}

\title{\textsc{Pycalcal} -- Literate Calendars in \py}
\author{Enrico Spinielli\thanks{\thankstext}}
@@ -107,16 +107,20 @@
\usepackage[pdftex]{graphicx}

% hyperref must be the last package to include
-\usepackage[pdfdisplaydoctitle=true,
- urlcolor=blue,
- linktocpage,
- a4paper=true,
- colorlinks=true,
- breaklinks=true,
- hypertexnames=false,
- pdftex]{hyperref}
+\usepackage{hyperref}

\hypersetup{%
+ pageanchor=true,
+ plainpages=false,
+ pdfpagelabels,
+ pagebackref,
+ pdfdisplaydoctitle=true,
+ urlcolor=blue,
+ linktocpage,
+ a4paper=true,
+ colorlinks=true,
+ breaklinks=true,
+ pdftex,
pdftitle={Pycalcal - Literate Calendars in Python},
pdfauthor={Enrico Spinielli},
pdfsubject={Calendrical algorithms in Python},
@@ -125,21 +129,27 @@
pdfproducer = {pdfLaTeX}}

\urlstyle{leostyle}
+
+
+\setcounter{tocdepth}{0} % indice fino a section
+
+
\begin{document}
-%
-%Set an additional Bookmark to the first Page
-\pdfbookmark[1]{Preamble}{prea}
\maketitle
\cleardoublepage %%% start again on odd page
%
% Table of Contents:
\pagenumbering{roman} %%% Roman page numbers for ToC
+\setcounter{page}{1}
\pdfbookmark[1]{Contents}{toc} %%% additional bookmark for ToC
-\thispagestyle{plain} %%% uses the above defined fancy
page-header
+\thispagestyle{plain} %%% uses the above defined fancy
+ %%% page-header
\tableofcontents
-\markboth{Table of Contents}{Table of Contents} %%% for the page header
+\markboth{Table of Contents}{Table of Contents} %%% for the page
+ %%% header
\cleardoublepage %%% start again on odd page
\pagenumbering{arabic} %%% from now on Arabic page numbers
+\setcounter{page}{1}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -147,28 +157,33 @@
\label{sec:goal}
%\lettrine[lhang=1, nindent=0pt, lines=3]{I}{n}
\lettrine[lines=3]{T}{his}
-describes the implementation of calendrical
-algorithms in the \py~\cite{computer:language:python} programming
-language. I tackled this task the Literate Programming
-way~\cite{literate:lp} using the \nw~tool.~\cite{literate:lps,
- noweb:distro} As such all code and documentation is generated and
-prefixed with the following warning:
-<<generated code warning>>=
-AUTOMATICALLY GENERATED FROM pycalcal.nw: ANY CHANGES WILL BE OVERWRITTEN.
-
-@
-The project is about implementing the algorithms
-described in \textit{Calendrical Calculations}~\cite{calendar:calcal}
-and implemented in (simple) \cl\ in package \texttt{CC3} in
-the companion file \texttt{calendrica-3.0.cl}.
-
-I provide full reference to the original \cl\ and credit (and deep respect)
-to its authors, Prof.s~Dershowitz and Reingold.
+document describes a \py~\cite{computer:language:python}
+implementation of the calendrical algorithms described in
+the book \textit{Calendrical Calculations}~\cite{calendar:calcal}.
+According to the authors, the book is textit{the companion} text of
+the algorithms
+implemented in the \cl\ package \texttt{CC3}.
+The source code for \texttt{CC3}, \texttt{calendrica-3.0.cl}, is made
+available electronically
+by the publisher, see \cite{calendar:calcal}.
+
+I provide full reference to the original \cl\ and credit (and deep
+respect) to its authors, Prof.s~Dershowitz and Reingold.

On the (long) way to complete this project, I experimented with
Scons~\cite{scons}, Test-Driven Development~\cite{tdd} and
web applications~\cite{google:appengine}.

+I tackled this task the Literate Programming
+way~\cite{literate:lp} using the \nw~tool.~\cite{literate:lps,
+noweb:distro}
+As such all code and documentation is generated from
+a single source file and prefixed with the following warning:
+<<generated code warning>>=
+AUTOMATICALLY GENERATED FROM pycalcal.nw: ANY CHANGES WILL BE OVERWRITTEN.
+
+@
+
\section{Structure}
\label{sec:structure}
The software is for now a single piece of text (a.k.a. a \py~file):
@@ -178,7 +193,7 @@
@ It is organised as follows:
<<pycalcal.py>>=
<<testa>>
-<<import statements>>
+<<global import statements>>
<<basic code>>
<<egyptian and armenian calendars>>
<<gregorian calendar>>
@@ -202,7 +217,7 @@
<<coda>>

@ There is as well a companion file with unit tests inspired by the
-examples in the book~\cite{calendar:calcal}, its Appendix C or
+examples spread in the book~\cite{calendar:calcal}, its Appendix C or
devised by myself.
<<pycalcaltests.py>>=
# <<generated code warning>>
@@ -238,15 +253,15 @@

<<execute tests>>

-@ The code for tests execution is:
+@ The code for tests execution is:
<<execute tests>>=
if __name__ == "__main__":
unittest.main()

@
-Also I want to be able to run a single unit tests part in isolation, i.e.
+Given I also want to be able to run a single unit tests part in isolation,
i.e.
when working on Persian calendar I just want to run the Persian
-calendar's tests.
+calendar's tests, I generate a unit tests file per each part.
Here is an example of how the unit tests are templated for an hypotetical
\texttt{xyzzy} calendar/section:
\begin{verbatim}
@@ -258,7 +273,7 @@
@<<execute tests>>
\end{verbatim}

-@ where the following imports are to be used:
+@ The following imports are to be used:
<<import for testing>>=
from pycalcal import *
import unittest
@@ -340,9 +355,9 @@
\lettrine[lines=3]{T}{he} accuracy of the algorthms presented require
definition of constants and calculations that span many bits.
I enable true division feature as in PEP~238~\cite{python:PEP238}
-in order to smoothly express simple constants define in the \cl\ code,
+in order to smoothly express simple constants as defined in the \cl\ code,
i.e. \texttt{1/360}
-<<import statements>>=
+<<global import statements>>=
# use true division
from __future__ import division

@@ -351,7 +366,7 @@
where numbers are postfixed with \texttt{L0}, meaning 50-bit precision,
I use the \texttt{mpmath} library~\cite{math:multiprecision} and set
the precision accordingly\index{floating-point arithmetic}.
-<<import statements>>=
+<<global import statements>>=
# Precision in bits, for places where CL postfixes numbers with L0, meaning
# at least 50 bits of precision
from mpmath import *
@@ -367,20 +382,8 @@
that will be used to perform a lot of the various calculations for the
subsequent calendars.

-The relevant tests are available to be run in isolation in
-\texttt{basicCodeUnitTest.py}
-<<basicCodeUnitTest.py>>=
-<<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable1TestCaseBase
-<<basic code unit test>>
-<<execute tests>>
-
-@ and grouped together so that they can be included in
\texttt{pycalcaltests.py}
-<<basic code unit test>>=
-class BasicCodeTestCase(unittest.TestCase):
- <<basic code tests>>
@
+\subsection{Implementation}
Some computations have meaningless results in certain circumstances,
they will return a predefined value, \texttt{BOGUS}, to mark this case.
<<basic code>>=
@@ -908,18 +911,28 @@
"""Return the modified Julian day corresponding to fixed date 'rd'."""
return date - MJD_EPOCH

-@
-%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Gregorian Calendar}
-\label{sec:gregoriancal}
-As usual the unit tests are as follows
-<<gregorianCalendarUnitTest.py>>=
+@
+
+\subsection{Unit tests}
+The relevant tests are available to be run in isolation in
+\texttt{basicCodeUnitTest.py}
+<<basicCodeUnitTest.py>>=
# <<generated code warning>>
<<import for testing>>
from appendixCUnitTest import AppendixCTable1TestCaseBase
-<<gregorian calendar unit test>>
+<<basic code unit test>>
<<execute tests>>
+
+@ and grouped together so that they can be included in
\texttt{pycalcaltests.py}
+<<basic code unit test>>=
+class BasicCodeTestCase(unittest.TestCase):
+ <<basic code tests>>
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Gregorian Calendar}
+\label{sec:gregoriancal}

<<gregorian calendar>>=
#################################
@@ -1266,20 +1279,21 @@
self.assertEqual(day_number(self.myDate), 30)
self.assertEqual(day_number(self.aLeapDate), 60)

-
-
@
-%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Julian Calendar}
-\label{sec:juliancal}
-
-<<julianCalendarUnitTest.py>>=
+\subsection{Unit tests}
+As usual the unit tests are as follows
+<<gregorianCalendarUnitTest.py>>=
# <<generated code warning>>
<<import for testing>>
from appendixCUnitTest import AppendixCTable1TestCaseBase
-<<julian calendar unit test>>
+<<gregorian calendar unit test>>
<<execute tests>>
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Julian Calendar}
+\label{sec:juliancal}

<<julian calendar>>=
##############################
@@ -1526,20 +1540,19 @@
in Gregorian year 'g_year'."""
return julian_in_gregorian(DECEMBER, 25, g_year)

-
-
@
-%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Egyptian/Armenian Calendars}\label{sec:egypt}
-The tests for Egyptian and Armenian calendars are following the usual
pattern as
-described in section~\ref{sec:structure}.
-<<egyptianAndArmenianCalendarsUnitTest.py>>=
+\subsection{Unit tests}
+<<julianCalendarUnitTest.py>>=
# <<generated code warning>>
<<import for testing>>
from appendixCUnitTest import AppendixCTable1TestCaseBase
-<<egyptian and armenian calendars unit test>>
+<<julian calendar unit test>>
<<execute tests>>
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Egyptian/Armenian Calendars}\label{sec:egypt}

<<egyptian and armenian calendars>>=
##############################################
@@ -1624,19 +1637,22 @@
self.assertEqual(
self.testvalue, fixed_from_armenian(self.aDate))

+@
+\subsection{Unit tests}
+The tests for Egyptian and Armenian calendars are following the usual
pattern as
+described in section~\ref{sec:structure}.
+<<egyptianAndArmenianCalendarsUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable1TestCaseBase
+<<egyptian and armenian calendars unit test>>
+<<execute tests>>

@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{ISO Calendar}
\label{sec:isocal}
-
-<<isoCalendarUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable1TestCaseBase
-<<iso calendar unit test>>
-<<execute tests>>

<<iso calendar>>=
###########################
@@ -1656,7 +1672,6 @@
def `iso_day(date):
"""Return the day of ISO date 'date'."""
return date[2]
-

# see lines 991-993 in calendrica-3.0.cl
def `iso_year(date):
@@ -1704,19 +1719,21 @@
self.assertEqual(
self.testvalue, fixed_from_iso(self.aDate))

+@
+\subsection{Unit tests}
+<<isoCalendarUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable1TestCaseBase
+<<iso calendar unit test>>
+<<execute tests>>
+
+
@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Coptic and Ethiopic Calendars}
\label{sec:copticcal}
-
-<<copticAndEthiopicCalendarsUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable1TestCaseBase
-from appendixCUnitTest import AppendixCTable2TestCaseBase
-<<coptic and ethiopic calendars unit test>>
-<<execute tests>>

<<coptic and ethiopic calendars>>=
# see lines 1277-1279 in calendrica-3.0.cl
@@ -1822,18 +1839,21 @@
self.assertEqual(
self.testvalue, fixed_from_ethiopic(ethiopic_date(1938, 3, 3)))

+@
+\subsection{Unit tests}
+<<copticAndEthiopicCalendarsUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable1TestCaseBase
+from appendixCUnitTest import AppendixCTable2TestCaseBase
+<<coptic and ethiopic calendars unit test>>
+<<execute tests>>
+
@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Ecclesiastical Calendars}
\label{sec:ecclesiacal}
-
-<<ecclesiasticalCalendarsUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable3TestCaseBase
-<<ecclesiastical calendars unit test>>
-<<execute tests>>

<<ecclesiastical calendars>>=
#######################################
@@ -1885,18 +1905,20 @@
<<ecclesiastical calendars unit test>>=


+@
+\subsection{Unit tests}
+<<ecclesiasticalCalendarsUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable3TestCaseBase
+<<ecclesiastical calendars unit test>>
+<<execute tests>>
+
@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Islamic Calendar}
\label{sec:islamiccal}
-
-<<islamicCalendarUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable2TestCaseBase
-<<islamic calendar unit test>>
-<<execute tests>>

<<islamic calendar>>=
###############################
@@ -1969,19 +1991,21 @@
self.assertEqual(
self.testvalue, fixed_from_islamic(islamic_date(1364, 12, 6)))

+@
+\subsection{Unit tests}
+<<islamicCalendarUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable2TestCaseBase
+<<islamic calendar unit test>>
+<<execute tests>>
+

@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Hebrew Calendar}
\label{sec:hebrewcal}
-
-<<hebrewCalendarUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable3TestCaseBase
-<<hebrew calendar unit test>>
-<<execute tests>>

<<hebrew calendar>>=
##############################
@@ -2383,19 +2407,21 @@
self.assertEqual(set(possible_hebrew_days(SHEVAT, 15)),
set([THURSDAY, SATURDAY, MONDAY, TUESDAY, WEDNESDAY]))

+@
+\subsection{Unit tests}
+<<hebrewCalendarUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable3TestCaseBase
+<<hebrew calendar unit test>>
+<<execute tests>>
+

@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Mayan Calendars}
\label{sec:mayancal}
-
-<<mayanCalendarsUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable2TestCaseBase
-<<mayan calendars unit test>>
-<<execute tests>>

<<mayan calendars>>=
##############################
@@ -2752,18 +2778,20 @@
aztec_xihuitl_date(2, 1), self.testvalue),
self.testvalue)

+@
+\subsection{Unit tests}
+<<mayanCalendarsUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable2TestCaseBase
+<<mayan calendars unit test>>
+<<execute tests>>
+
@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Old Hindu Calendars}
\label{sec:oldinducal}
-
-<<oldHinduCalendarsUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable4TestCaseBase
-<<old hindu calendars unit test>>
-<<execute tests>>

<<old hindu calendars>>=
##################################
@@ -2932,18 +2960,20 @@
fixed_from_old_hindu_lunar(
old_hindu_lunar_date(5046, 8, False, 8)))

+@
+\subsection{Unit tests}
+<<oldHinduCalendarsUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable4TestCaseBase
+<<old hindu calendars unit test>>
+<<execute tests>>
+
@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Balinese Calendar}
\label{sec:balinesecal}
-
-<<balineseCalendarUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable3TestCaseBase
-<<balinese calendar unit test>>
-<<execute tests>>

<<balinese calendar>>=
################################
@@ -3137,13 +3167,38 @@
self.testvalue),
self.testvalue)

+@
+\subsection{Unit tests}
+<<balineseCalendarUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable3TestCaseBase
+<<balinese calendar unit test>>
+<<execute tests>>
+
@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Time and Astronomy}
\label{sec:astro}
+The location of an object in the sky is determined by celestial
+coordinates, analogous to the latitude and longotude for the location
+of a position of Earth.
\subsection{$alt-az$ Coordinate systems}
\label{sec:alt-az}
+The alt-az is a topocentric (i.e. as seen from the observer's
+place on the Earth's surface) celestial coordinate system.
+It uses the horizon as its fundamental circle which divides the sky in
+two emispheres. The pole of the upper hemisphere is called the zenith,
+while the one of the lower hemisphere is called nadir. These are
+defined by the local vertical (using a plumb-line or similar).
+The point of origin on the horizon is determined by the intersection
+of the vertical circle (i.e. trhough zenith and nadir) passing through
+north and south celestial pole.
+
+The azimith (A) is the direction of a celestial object, measured
+clockwise around the observer's horizon from south.
+

\subsection{$HA-dec$ Coordinate systems}
\label{sec:HA-dec}
@@ -3186,13 +3241,6 @@
\end{figure}
@

-<<timeAndAstronomyUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable5TestCaseBase
-<<time and astronomy unit test>>
-<<execute tests>>
-


<<time and astronomy>>=
@@ -4613,19 +4661,21 @@
return deg(1792367000/9) / lunar_distance(tee)


+@
+\subsection{Unit tests}
+<<timeAndAstronomyUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable5TestCaseBase
+<<time and astronomy unit test>>
+<<execute tests>>
+

@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Persian Calendar}
\label{sec:persiancal}
-
-<<persianCalendarUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable3TestCaseBase
-<<persian calendar unit test>>
-<<execute tests>>

<<persian calendar>>=
###############################
@@ -4744,19 +4794,21 @@
@
<<persian calendar unit test>>=

+@
+\subsection{Unit tests}
+<<persianCalendarUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable3TestCaseBase
+<<persian calendar unit test>>
+<<execute tests>>
+

@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Bahai Calendar}
\label{sec:bahaical}
-
-<<bahaiCalendarUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable2TestCaseBase
-<<bahai calendar unit test>>
-<<execute tests>>

<<bahai calendar>>=
#############################
@@ -4939,19 +4991,21 @@
@
<<bahai calendar unit test>>=

+@
+\subsection{Unit tests}
+<<bahaiCalendarUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable2TestCaseBase
+<<bahai calendar unit test>>
+<<execute tests>>
+

@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{French Revolutionary Calendar}
\label{sec:frenchcal}
-
-<<frenchRevolutionaryCalendarUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable3TestCaseBase
-<<french revolutionary calendar unit test>>
-<<execute tests>>

<<french revolutionary calendar>>=
############################################
@@ -5063,19 +5117,21 @@
@
<<french revolutionary calendar unit test>>=

+@
+\subsection{Unit tests}
+<<frenchRevolutionaryCalendarUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable3TestCaseBase
+<<french revolutionary calendar unit test>>
+<<execute tests>>
+

@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Chinese Calendar}
\label{sec:chinesecal}
-
-<<chineseCalendarUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable4TestCaseBase
-<<chinese calendar unit test>>
-<<execute tests>>

<<chinese calendar>>=
###############################
@@ -5485,17 +5541,20 @@
#############################################

@
-%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Modern Hindu Calendars}
-\label{sec:modernhinducal}
-
-<<modernHinduCalendarsUnitTest.py>>=
+\subsection{Unit tests}
+<<chineseCalendarUnitTest.py>>=
# <<generated code warning>>
<<import for testing>>
from appendixCUnitTest import AppendixCTable4TestCaseBase
-<<modern hindu calendars unit test>>
+<<chinese calendar unit test>>
<<execute tests>>
+
+
+@
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Modern Hindu Calendars}
+\label{sec:modernhinducal}

<<modern hindu calendars>>=
#####################################
@@ -6254,19 +6313,21 @@
@
<<modern hindu calendars unit test>>=

+@
+\subsection{Unit tests}
+<<modernHinduCalendarsUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable4TestCaseBase
+<<modern hindu calendars unit test>>
+<<execute tests>>
+

@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Tibetan Calendar}
\label{sec:tibetancal}
-
-<<tibetanCalendarUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable4TestCaseBase
-<<tibetan calendar unit test>>
-<<execute tests>>

<<tibetan calendar>>=
###############################
@@ -6431,23 +6492,21 @@
@
<<tibetan calendar unit test>>=

+@
+\subsection{Unit tests}
+<<tibetanCalendarUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable4TestCaseBase
+<<tibetan calendar unit test>>
+<<execute tests>>
+

@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Astronomical Lunar Calendars}
\label{sec:astrolunarcal}
-
-<<astronomicalLunarCalendarsUnitTest.py>>=
-# <<generated code warning>>
-<<import for testing>>
-from appendixCUnitTest import AppendixCTable5TestCaseBase
-<<astronomical lunar calendars unit test>>
-<<execute tests>>
-
-<<astronomical lunar calendars unit test>>=
-class `AstronomicalLunarCalendarsTestCase(unittest.TestCase):
- <<astronomical lunar tests>>

<<astronomical lunar calendars>>=
###########################################
@@ -6581,10 +6640,25 @@
(Nisan 14) occurring in Gregorian year, g_year."""
return observational_hebrew_new_year(g_year) + 13

+
@
<<coda>>=
# That's all folks!

+@
+\subsection{Unit tests}
+<<astronomicalLunarCalendarsUnitTest.py>>=
+# <<generated code warning>>
+<<import for testing>>
+from appendixCUnitTest import AppendixCTable5TestCaseBase
+<<astronomical lunar calendars unit test>>
+<<execute tests>>
+
+<<astronomical lunar calendars unit test>>=
+class `AstronomicalLunarCalendarsTestCase(unittest.TestCase):
+ <<astronomical lunar tests>>
+
+
@
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -8107,7 +8181,7 @@
.PRECIOUS: %.aux %.bbl

.PHONY : all
-all: pycalcal.pdf $(NW_MAIN:.nw=.py) pycalcaltests.py
+all: figure pycalcal.pdf $(NW_MAIN:.nw=.py) pycalcaltests.py

.PHONY : index
pycalcal.defs: $(NW_MAIN) premarkup
@@ -8697,42 +8771,35 @@
mpf('279283278.7852416')
\end{verbatim}

-\cleardoublepage
+
+%\clearpage
\addcontentsline{toc}{chapter}{\bibname}
\bibliographystyle{plain}
\bibliography{pycalcal}
+\label{sec:biblio}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\appendix
-\appendixpage
-\addappheadtotoc
-%\chapter{Chunks Information}
-
+%\appendixpage
+%\addappheadtotoc
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
-\section*{Chunks Index}
+\chapter{Chunks}
+\section{Chunks Index}
\label{sec:chunks}
\nowebchunks

%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
-\section*{Chunks Identifiers}
+\section{Chunks Identifiers}
\label{sec:ids}
\nowebindex


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\markboth{Index}{Index}
-\begingroup
- \let\clearpage\relax
- \let\cleardoublepage\relax
- \let\cleardoublepage\relax
-\pagestyle{plain}
-\addcontentsline{toc}{chapter}{Index}
-\endgroup
\printindex

\end{document}

Reply all
Reply to author
Forward
0 new messages