Skip to content

Commit

Permalink
Replace | by ` in (most) comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
pleroy committed Sep 9, 2024
1 parent 034a191 commit 447d2d1
Show file tree
Hide file tree
Showing 341 changed files with 2,296 additions and 2,296 deletions.
24 changes: 12 additions & 12 deletions astronomy/date_time.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ namespace internal {
class Date final {
public:
// The calendar is Gregorian by default starting in 1583; before that,
// |calendar| is required.
// `calendar` is required.
static constexpr Date YYYYMMDD(
std::int64_t digits,
std::optional<Calendar> calendar = std::nullopt);
// The calendar is Gregorian by default starting in 1583; before that,
// |calendar| is required.
// `calendar` is required.
static constexpr Date YYYYDDD(
std::int64_t digits,
std::optional<Calendar> calendar = std::nullopt);
Expand All @@ -37,21 +37,21 @@ class Date final {
static constexpr Date YYYYwwD(std::int64_t digits);

// The calendar is Gregorian by default starting in 1583; before that,
// |calendar| is required.
// `calendar` is required.
static constexpr Date Calendar(
int year, int month, int day,
std::optional<Calendar> calendar = std::nullopt);
// The calendar is Gregorian by default starting in 1583; before that,
// |calendar| is required.
// `calendar` is required.
static constexpr Date Ordinal(
int year, int day,
std::optional<_date_time::Calendar> calendar = std::nullopt);
// Since the calendar week number is an ISO 8601 construct, the year must be
// at least 1583, and the calendar is Gregorian.
static constexpr Date Week(int year, int week, int day);

// The julian date |jd| must not be negative; its fractional part must be one
// half, corresponding to 00:00 on the resulting |Date|.
// The julian date `jd` must not be negative; its fractional part must be one
// half, corresponding to 00:00 on the resulting `Date`.
static constexpr Date JD(double jd);

constexpr int year() const;
Expand All @@ -61,7 +61,7 @@ class Date final {

constexpr int ordinal() const;

// The fractional part of |jd()| is one half, corresponding to 00:00 on the
// The fractional part of `jd()` is one half, corresponding to 00:00 on the
// day represented by this object.
constexpr double jd() const;
constexpr int mjd() const;
Expand Down Expand Up @@ -93,7 +93,7 @@ class TimeOfDay final {
constexpr int millisecond() const;

constexpr bool is_leap_second() const;
// Whether |*this| is 24:00:00.
// Whether `*this` is 24:00:00.
constexpr bool is_end_of_day() const;

private:
Expand All @@ -107,7 +107,7 @@ class TimeOfDay final {

class DateTime final {
public:
// Checks that |time| does not represent a leap second unless |date| is the
// Checks that `time` does not represent a leap second unless `date` is the
// last day of the month.
constexpr DateTime(Date date, TimeOfDay time);

Expand All @@ -116,8 +116,8 @@ class DateTime final {
constexpr Date const& date() const;
constexpr TimeOfDay const& time() const;

// If |time()| is 24:00:00, returns an equivalent DateTime where midnight is
// expressed as 00:00:00 on the next day; otherwise, returns |*this|.
// If `time()` is 24:00:00, returns an equivalent DateTime where midnight is
// expressed as 00:00:00 on the next day; otherwise, returns `*this`.
constexpr DateTime normalized_end_of_day() const;

private:
Expand Down Expand Up @@ -146,7 +146,7 @@ class JulianDate final {
std::int64_t fraction_numerator,
std::int64_t fraction_denominator);

// These numbers are relative to J2000. |fraction_denominator| is a positive
// These numbers are relative to J2000. `fraction_denominator` is a positive
// power of 10.
std::int64_t const day_;
std::int64_t const fraction_numerator_;
Expand Down
46 changes: 23 additions & 23 deletions astronomy/date_time_body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ constexpr int number_of_iso_weeks_in_year(int const year) {
: 52;
}

// Returns the ordinal in |year| of the first day of the first week of |year|.
// Returns the ordinal in `year` of the first day of the first week of `year`.
// The result is in [-2, 4], with values in [-2, 0] meaning that the first week
// of |year| starts in |year - 1|.
// A result in [-2, 1] means that the first day of |year| is in the first week
// of |year|; otherwise, it is in the last week of |year - 1|.
// of `year` starts in `year - 1`.
// A result in [-2, 1] means that the first day of `year` is in the first week
// of `year`; otherwise, it is in the last week of `year - 1`.
constexpr int ordinal_of_w_01_1(int const year) {
return mod(2 - day_of_week_on_january_1st(year), 7, -2);
}

// Returns the number formed by taking |end - begin| increasingly significant
// digits, starting from the digit of the (10 ** |begin|)s.
// Returns the number formed by taking `end - begin` increasingly significant
// digits, starting from the digit of the (10 ** `begin`)s.
constexpr std::int64_t digit_range(std::int64_t const digits,
int const begin,
int const end) {
Expand Down Expand Up @@ -94,7 +94,7 @@ constexpr std::int64_t shift_right(std::int64_t const x, int const count) {
return count == 0 ? x : shift_right(x / 10, count - 1);
}

// Implementation of class |Date|.
// Implementation of class `Date`.

constexpr Date Date::YYYYMMDD(
std::int64_t const digits,
Expand Down Expand Up @@ -466,12 +466,12 @@ constexpr CStringIterator::CStringIterator(char const* const str,

// Date parsing.

// A |DateParser| contains information about a string necessary to interpret it
// A `DateParser` contains information about a string necessary to interpret it
// as a date representation.
class DateParser final {
public:
// Returns a |Date| corresponding to the representation |str|.
// Fails unless |str| is a date representation of one of the following forms:
// Returns a `Date` corresponding to the representation `str`.
// Fails unless `str` is a date representation of one of the following forms:
// [YYYY-MM-DD], [YYYYMMDD], [YYYY-Www-D], [YYYYWwwD], [YYYY-DDD], [YYYYDDD],
// with an optional prefix [J] or [G] and an optional sign.
static constexpr Date Parse(char const* str, std::size_t size);
Expand All @@ -485,7 +485,7 @@ class DateParser final {
bool has_w,
int w_index);

// Returns a |DateParser| describing the given string. Fails if the string
// Returns a `DateParser` describing the given string. Fails if the string
// does not exclusively consist of:
// - any number of decimal digits;
// - at most two hyphens;
Expand All @@ -501,7 +501,7 @@ class DateParser final {
bool has_w,
int w_index);

// Returns a |Date| corresponding to the string that |*this| describes.
// Returns a `Date` corresponding to the string that `*this` describes.
// Fails if the format is invalid or the string represents an invalid date.
constexpr Date ToDate(std::optional<Calendar> calendar, bool negative) const;

Expand Down Expand Up @@ -661,12 +661,12 @@ constexpr Date DateParser::ToDate(std::optional<Calendar> const calendar,

// TimeOfDay parsing.

// A |TimeParser| contains information about a string necessary to interpret it
// A `TimeParser` contains information about a string necessary to interpret it
// as a time representation.
class TimeParser final {
public:
// Returns a |TimeOfDay| corresponding to the representation |str|.
// Fails unless |str| is a valid time representation of one of the following
// Returns a `TimeOfDay` corresponding to the representation `str`.
// Fails unless `str` is a valid time representation of one of the following
// forms: [hh:mm:ss], [hhmmss], [hh:mm:ss.ss̲], [hh:mm:ss,ss̲], [hhmmss.ss̲],
// [hhmmss,ss̲], with at most three digits after the decimal mark.
static constexpr TimeOfDay Parse(char const* str, std::size_t size);
Expand All @@ -680,7 +680,7 @@ class TimeParser final {
bool has_decimal_mark,
int decimal_mark_index);

// Returns a |TimeParser| describing the given string. Fails if the string
// Returns a `TimeParser` describing the given string. Fails if the string
// does not exclusively consist of:
// Fails if the string does not exclusively consist of:
// - any number of decimal digits;
Expand All @@ -697,7 +697,7 @@ class TimeParser final {
bool has_decimal_mark,
int decimal_mark_index);

// Returns a |TimeOfDay| corresponding to the string that |*this| describes.
// Returns a `TimeOfDay` corresponding to the string that `*this` describes.
// Fails if the format is invalid or the string represents an invalid time.
constexpr TimeOfDay ToTime() const;

Expand Down Expand Up @@ -837,15 +837,15 @@ constexpr TimeOfDay TimeParser::ToTime() const {

// Julian date parsing.

// A |JulianDateParser| contains information about a string necessary to
// A `JulianDateParser` contains information about a string necessary to
// interpret it as a Julian date.
class JulianDateParser final {
public:
// Returns a |JulianDate| corresponding to the representation |str|.
// Fails unless |str| is a valid time representation of the form [ddd] or
// Returns a `JulianDate` corresponding to the representation `str`.
// Fails unless `str` is a valid time representation of the form [ddd] or
// [ddd.fff].

// Returns a |JulianDate| object corresponding to the given string interpreted
// Returns a `JulianDate` object corresponding to the given string interpreted
// a Julian Date or a Modified Julian Date, respectively.
static constexpr JulianDate ParseJD(char const* str, std::size_t size);
static constexpr JulianDate ParseMJD(char const* str, std::size_t size);
Expand All @@ -855,7 +855,7 @@ class JulianDateParser final {
int digit_count,
int decimal_mark_index);

// Returns a |JulianDateParser| describing the given string. Fails if the
// Returns a `JulianDateParser` describing the given string. Fails if the
// string is not of the form [ddd] or [ddd.fff] or if it has too many digits
// to fit in a std::int64_t.
static constexpr JulianDateParser ReadToEnd(char const* str,
Expand All @@ -866,7 +866,7 @@ class JulianDateParser final {
bool has_decimal_mark,
int decimal_mark_index);

// Returns a |JulianDate| corresponding to the string that |*this| describes.
// Returns a `JulianDate` corresponding to the string that `*this` describes.
// Fails if the format is invalid.
constexpr JulianDate ToJD() const;
constexpr JulianDate ToMJD() const;
Expand Down
4 changes: 2 additions & 2 deletions astronomy/epoch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "geometry/instant.hpp"

// |geometry::Instant| represents instants of Terrestrial Time (TT). The
// `geometry::Instant` represents instants of Terrestrial Time (TT). The
// utilities in this file provide its standard epoch and two ways of specifying
// TT dates.

Expand All @@ -13,7 +13,7 @@ namespace internal {

using namespace principia::geometry::_instant;

// |J2000| represents to the standard epoch J2000.0.
// `J2000` represents to the standard epoch J2000.0.
// According to Resolution B1 (On the Use of Julian Dates) of the XXIIIrd IAU
// general assembly, "it is recommended that JD be specified as SI seconds in
// Terrestrial Time (TT)", see http://goo.gl/oPemRm. J2000.0 is by definition
Expand Down
4 changes: 2 additions & 2 deletions astronomy/frames.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ using ICRS = Frame<serialization::Frame::SolarSystemTag,
// - The time coordinate of the BCRS is TCB, and the time coordinate of the GCRS
// is TCG; TT is a linear scaling of TCG, and TDB is a linear scaling of TCB;
// for practical purposes TT and TDB are within 2 ms of each other;
// Principia's |Instant| is TT.
// Principia's `Instant` is TT.
using GCRS = Frame<serialization::Frame::SolarSystemTag,
NonRotating,
Handedness::Right,
Expand All @@ -71,7 +71,7 @@ using GCRS = Frame<serialization::Frame::SolarSystemTag,
// - This is identical to WGS84 at 1 m level, and to recent realizations of WGS
// 84 at 10 cm level; the xz plane is a bit over a hundred metres from the
// Royal Observatory in Greenwich.
// Caveat: using |SphericalCoordinates<Length>| on ITRS coordinates is
// Caveat: using `SphericalCoordinates<Length>` on ITRS coordinates is
// inconsistent with WGS 84 latitudes; the WGS 84 geoid should be used.
// - The ITRS is related to the European Terrestrial Reference System (ETRS89)
// by a time-dependent rigid transformation.
Expand Down
10 changes: 5 additions & 5 deletions astronomy/lunar_eclipse_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class LunarEclipseTest : public ::testing::Test {
atmospheric_depth_ = (1.0 / 85.0 - 1.0 / 594.0) * r_earth_;
}

// A positive |time_error| means that the actual contact happens after
// |current_time|.
// A positive `time_error` means that the actual contact happens after
// `current_time`.
void CheckLunarUmbralEclipse(Instant const& current_time,
Sign const moon_offset_sign,
ApproximateQuantity<Angle> const& angular_error,
Expand Down Expand Up @@ -112,7 +112,7 @@ class LunarEclipseTest : public ::testing::Test {
(r_earth_ + atmospheric_depth_ + moon_offset_sign * r_moon_) /
Sin(umbral_half_aperture(t));
// Angle between Earth and Moon as seen at
// |apex_of_moon_locus_at_umbral_contact|.
// `apex_of_moon_locus_at_umbral_contact`.
return AngleBetween(apex_of_moon_locus_at_umbral_contact - q_earth,
apex_of_moon_locus_at_umbral_contact - q_moon);
};
Expand All @@ -139,8 +139,8 @@ class LunarEclipseTest : public ::testing::Test {
<< " " << actual_contact_time - current_time;
}

// A positive |time_error| means that the actual contact happens after
// |current_time|.
// A positive `time_error` means that the actual contact happens after
// `current_time`.
void CheckLunarPenumbralEclipse(
Instant const& current_time,
Sign const moon_offset_sign,
Expand Down
6 changes: 3 additions & 3 deletions astronomy/lunar_orbit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ class LunarOrbitTest : public ::testing::TestWithParam<GeopotentialTruncation> {
// This reference frame is non-rotating, with its origin at the selenocentre.
// The axes are those of LunarSurface at J2000.
// Note that this frame is not actually inertial, but we want to use it with
// |KeplerOrbit|. Perhaps we should have a concept of non-rotating, and
// |KeplerOrbit| should check that; this is good enough for a test.
// `KeplerOrbit`. Perhaps we should have a concept of non-rotating, and
// `KeplerOrbit` should check that; this is good enough for a test.
using Selenocentric = Frame<struct SelenocentricTag, Inertial>;

// We do not use a |BodyCentredNonRotatingReferenceFrame| since that would use
// We do not use a `BodyCentredNonRotatingReferenceFrame` since that would use
// ICRS axes.
RigidMotion<ICRS, Selenocentric> ToSelenocentric(Instant const& t) {
return RigidMotion<ICRS, Selenocentric>(
Expand Down
2 changes: 1 addition & 1 deletion astronomy/orbit_analysis_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class OrbitAnalysisTest : public ::testing::Test {
earth_(*earth_1957_.rotating_body(*ephemeris_, "Earth")) {}

// Returns a GCRS trajectory obtained by stitching together the trajectories
// of |sp3_orbit.satellites| in |sp3_orbit.files|.
// of `sp3_orbit.satellites` in `sp3_orbit.files`.
not_null<std::unique_ptr<DiscreteTrajectory<GCRS>>> EarthCentredTrajectory(
SP3Orbit const& sp3_orbit) {
BodyCentredNonRotatingReferenceFrame<ICRS, GCRS> gcrs{ephemeris_.get(),
Expand Down
14 changes: 7 additions & 7 deletions astronomy/orbit_ground_track.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class OrbitGroundTrack {
struct MeanSun {
Instant epoch;
// This mean longitude of the sun is with respect to the axes of
// |PrimaryCentred|.
// `PrimaryCentred`.
Angle mean_longitude_at_epoch;
// This year is the period of the above mean longitude; which kind of year
// it is depends on the definition of |PrimaryCentred|. If |PrimaryCentred|
// has ICRS axes, it is the sidereal year; if |PrimaryCentred| is the
// it is depends on the definition of `PrimaryCentred`. If `PrimaryCentred`
// has ICRS axes, it is the sidereal year; if `PrimaryCentred` is the
// reference frame of the equator & equinox of the date, it is the tropical
// year.
Time year;
Expand Down Expand Up @@ -66,7 +66,7 @@ class OrbitGroundTrack {
OrbitGroundTrack& operator=(OrbitGroundTrack&&) = default;

// Returns an object that describes the properties of the ground track of
// |trajectory| as an orbit around |primary|; if |mean_sun| is provided,
// `trajectory` as an orbit around `primary`; if `mean_sun` is provided,
// sun-synchronicity is analysed.
template<typename PrimaryCentred, typename Inertial>
static absl::StatusOr<OrbitGroundTrack> ForTrajectory(
Expand All @@ -76,7 +76,7 @@ class OrbitGroundTrack {

// Given a nominal recurrence and the index of the first ascending pass east
// of the equator (which must be odd and in [1, 2 Nᴛₒ - 1], where Nᴛₒ is
// |nominal_recurrence.number_of_revolutions()|), returns an object describing
// `nominal_recurrence.number_of_revolutions()`), returns an object describing
// how the recurrence grid is aligned in longitude, and how well the actual
// orbit follows that grid.
EquatorCrossingLongitudes equator_crossing_longitudes(
Expand All @@ -97,9 +97,9 @@ class OrbitGroundTrack {

std::vector<Angle> longitudes_of_equator_crossings_of_ascending_passes_;
std::vector<Angle> longitudes_of_equator_crossings_of_descending_passes_;
// Whether |longitudes_of_equator_crossings_of_descending_passes_.front()| is
// Whether `longitudes_of_equator_crossings_of_descending_passes_.front()` is
// the longitude of the pass preceding
// |longitudes_of_equator_crossings_of_ascending_passes_.front()|, rather than
// `longitudes_of_equator_crossings_of_ascending_passes_.front()`, rather than
// the following one.
bool first_descending_pass_before_first_ascending_pass_;
std::optional<Interval<Angle>> mean_solar_times_of_ascending_nodes_;
Expand Down
Loading

0 comments on commit 447d2d1

Please sign in to comment.