Representations¶
Here we explain our approach to representing our objects, particularly in IPython notebooks.
As background, the way we approach this is based on three key sources:
- the difference between
__repr__and__str__in Python (see e.g. https://realpython.com/python-repr-vs-str/) - the advice from the IPython docs about prettifying output (https://ipython.readthedocs.io/en/8.26.0/config/integrating.html#rich-display)
- the way that xarray handles formatting (see https://github.com/pydata/xarray/blob/main/xarray/core/formatting.py)
- the way that pint handles formatting (see https://github.com/hgrecco/pint/blob/74b708661577623c0c288933d8ed6271f32a4b8b/pint/util.py#L1004)
In short, we try and have as nice an experience for developers as possible.
(As one other note/trick for representation of objects, you can control how numpy represents its objects using numpy.set_printoptions).
Imports¶
import numpy as np
import pint
from IPython.lib.pretty import pretty
import continuous_timeseries as ct
Set up pint¶
UR = pint.get_application_registry()
Q = UR.Quantity
Set up some example objects¶
basic_ts = ct.TimeseriesDiscrete(
name="basic",
time_axis=ct.TimeAxis(Q([1750.0, 1850.0, 1950.0], "yr")),
values_at_bounds=ct.ValuesAtBounds(Q([1.0, 2.0, 3.0], "m")),
)
basic_ts
| name | basic | ||||||
|---|---|---|---|---|---|---|---|
| time_axis |
|
||||||
| values_at_bounds |
|
long_ts = ct.TimeseriesDiscrete(
name="basic",
time_axis=ct.TimeAxis(Q(np.arange(1850.0, 2300.0, 1), "yr")),
values_at_bounds=ct.ValuesAtBounds(Q(np.arange(450.0), "m")),
)
long_ts
| name | basic | ||||||
|---|---|---|---|---|---|---|---|
| time_axis |
|
||||||
| values_at_bounds |
|
really_long_ts = ct.TimeseriesDiscrete(
name="basic",
time_axis=ct.TimeAxis(Q(np.arange(1850.0, 2300.0, 1 / 12), "yr")),
values_at_bounds=ct.ValuesAtBounds(Q(np.arange(450.0 * 12), "m")),
)
really_long_ts
| name | basic | ||||||
|---|---|---|---|---|---|---|---|
| time_axis |
|
||||||
| values_at_bounds |
|
HTML representation¶
In a notebook environment, the default view is the HTML representation. If you're running this in a notebook, that is what you will have already seen above.
As a reminder, here is the default view.
basic_ts
| name | basic | ||||||
|---|---|---|---|---|---|---|---|
| time_axis |
|
||||||
| values_at_bounds |
|
Here is the HTML representation of the wrapped values.
basic_ts.values_at_bounds
| values |
|
|---|
basic_ts.values_at_bounds.values
| Magnitude | [1.0 2.0 3.0] |
|---|---|
| Units | meter |
Here is the raw HTML which is generated and sits underneath this view.
print(basic_ts._repr_html_())
<div>
<style>
.continuous-timeseries-wrap {
/*font-family: monospace;*/
width: 540px;
}
.continuous-timeseries-header {
padding: 6px 0 6px 3px;
}
.continuous-timeseries-header > div {
display: inline;
margin-top: 0;
margin-bottom: 0;
}
.continuous-timeseries-cls {
margin-left: 2px;
margin-right: 10px;
}
.continuous-timeseries-cls {
font-weight: bold;
}
</style>
<div class='continuous-timeseries-wrap'>
<div class='continuous-timeseries-header'>
<div class='continuous-timeseries-cls'>continuous_timeseries.TimeseriesDiscrete</div>
<table><tbody>
<tr>
<th>name</th>
<td style='text-align:left;'>
basic
</td>
</tr>
<tr>
<th>time_axis</th>
<td style='text-align:left;'>
<table><tbody>
<tr>
<th>bounds</th>
<td style='text-align:left;'>
<table><tbody><tr><th>Magnitude</th><td style='text-align:left;'><pre>[1750.0 1850.0 1950.0]</pre></td></tr><tr><th>Units</th><td style='text-align:left;'>year</td></tr></tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<th>values_at_bounds</th>
<td style='text-align:left;'>
<table><tbody>
<tr>
<th>values</th>
<td style='text-align:left;'>
<table><tbody><tr><th>Magnitude</th><td style='text-align:left;'><pre>[1.0 2.0 3.0]</pre></td></tr><tr><th>Units</th><td style='text-align:left;'>meter</td></tr></tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
long_ts._repr_html_()
"<div>\n <style>\n.continuous-timeseries-wrap {\n /*font-family: monospace;*/\n width: 540px;\n}\n\n.continuous-timeseries-header {\n padding: 6px 0 6px 3px;\n}\n\n.continuous-timeseries-header > div {\n display: inline;\n margin-top: 0;\n margin-bottom: 0;\n}\n\n.continuous-timeseries-cls {\n margin-left: 2px;\n margin-right: 10px;\n}\n\n.continuous-timeseries-cls {\n font-weight: bold;\n}\n </style>\n <div class='continuous-timeseries-wrap'>\n <div class='continuous-timeseries-header'>\n <div class='continuous-timeseries-cls'>continuous_timeseries.TimeseriesDiscrete</div>\n <table><tbody>\n <tr>\n <th>name</th>\n <td style='text-align:left;'>\n basic\n </td>\n </tr>\n <tr>\n <th>time_axis</th>\n <td style='text-align:left;'>\n <table><tbody>\n <tr>\n <th>bounds</th>\n <td style='text-align:left;'>\n <table><tbody><tr><th>Magnitude</th><td style='text-align:left;'><pre>[1850.0 1851.0 1852.0 1853.0 1854.0 1855.0 1856.0 1857.0 1858.0 1859.0 1860.0 1861.0 1862.0 1863.0 1864.0 1865.0 1866.0 1867.0 1868.0 1869.0 1870.0 1871.0 1872.0 1873.0 1874.0 1875.0 1876.0 1877.0 1878.0 1879.0 1880.0 1881.0 1882.0 1883.0 1884.0 1885.0 1886.0 1887.0 1888.0 1889.0 1890.0 1891.0 1892.0 1893.0 1894.0 1895.0 1896.0 1897.0 1898.0 1899.0 1900.0 1901.0 1902.0 1903.0 1904.0 1905.0 1906.0 1907.0 1908.0 1909.0 1910.0 1911.0 1912.0 1913.0 1914.0 1915.0 1916.0 1917.0 1918.0 1919.0 1920.0 1921.0 1922.0 1923.0 1924.0 1925.0 1926.0 1927.0 1928.0 1929.0 1930.0 1931.0 1932.0 1933.0 1934.0 1935.0 1936.0 1937.0 1938.0 1939.0 1940.0 1941.0 1942.0 1943.0 1944.0 1945.0 1946.0 1947.0 1948.0 1949.0 1950.0 1951.0 1952.0 1953.0 1954.0 1955.0 1956.0 1957.0 1958.0 1959.0 1960.0 1961.0 1962.0 1963.0 1964.0 1965.0 1966.0 1967.0 1968.0 1969.0 1970.0 1971.0 1972.0 1973.0 1974.0 1975.0 1976.0 1977.0 1978.0 1979.0 1980.0 1981.0 1982.0 1983.0 1984.0 1985.0 1986.0 1987.0 1988.0 1989.0 1990.0 1991.0 1992.0 1993.0 1994.0 1995.0 1996.0 1997.0 1998.0 1999.0 2000.0 2001.0 2002.0 2003.0 2004.0 2005.0 2006.0 2007.0 2008.0 2009.0 2010.0 2011.0 2012.0 2013.0 2014.0 2015.0 2016.0 2017.0 2018.0 2019.0 2020.0 2021.0 2022.0 2023.0 2024.0 2025.0 2026.0 2027.0 2028.0 2029.0 2030.0 2031.0 2032.0 2033.0 2034.0 2035.0 2036.0 2037.0 2038.0 2039.0 2040.0 2041.0 2042.0 2043.0 2044.0 2045.0 2046.0 2047.0 2048.0 2049.0 2050.0 2051.0 2052.0 2053.0 2054.0 2055.0 2056.0 2057.0 2058.0 2059.0 2060.0 2061.0 2062.0 2063.0 2064.0 2065.0 2066.0 2067.0 2068.0 2069.0 2070.0 2071.0 2072.0 2073.0 2074.0 2075.0 2076.0 2077.0 2078.0 2079.0 2080.0 2081.0 2082.0 2083.0 2084.0 2085.0 2086.0 2087.0 2088.0 2089.0 2090.0 2091.0 2092.0 2093.0 2094.0 2095.0 2096.0 2097.0 2098.0 2099.0 2100.0 2101.0 2102.0 2103.0 2104.0 2105.0 2106.0 2107.0 2108.0 2109.0 2110.0 2111.0 2112.0 2113.0 2114.0 2115.0 2116.0 2117.0 2118.0 2119.0 2120.0 2121.0 2122.0 2123.0 2124.0 2125.0 2126.0 2127.0 2128.0 2129.0 2130.0 2131.0 2132.0 2133.0 2134.0 2135.0 2136.0 2137.0 2138.0 2139.0 2140.0 2141.0 2142.0 2143.0 2144.0 2145.0 2146.0 2147.0 2148.0 2149.0 2150.0 2151.0 2152.0 2153.0 2154.0 2155.0 2156.0 2157.0 2158.0 2159.0 2160.0 2161.0 2162.0 2163.0 2164.0 2165.0 2166.0 2167.0 2168.0 2169.0 2170.0 2171.0 2172.0 2173.0 2174.0 2175.0 2176.0 2177.0 2178.0 2179.0 2180.0 2181.0 2182.0 2183.0 2184.0 2185.0 2186.0 2187.0 2188.0 2189.0 2190.0 2191.0 2192.0 2193.0 2194.0 2195.0 2196.0 2197.0 2198.0 2199.0 2200.0 2201.0 2202.0 2203.0 2204.0 2205.0 2206.0 2207.0 2208.0 2209.0 2210.0 2211.0 2212.0 2213.0 2214.0 2215.0 2216.0 2217.0 2218.0 2219.0 2220.0 2221.0 2222.0 2223.0 2224.0 2225.0 2226.0 2227.0 2228.0 2229.0 2230.0 2231.0 2232.0 2233.0 2234.0 2235.0 2236.0 2237.0 2238.0 2239.0 2240.0 2241.0 2242.0 2243.0 2244.0 2245.0 2246.0 2247.0 2248.0 2249.0 2250.0 2251.0 2252.0 2253.0 2254.0 2255.0 2256.0 2257.0 2258.0 2259.0 2260.0 2261.0 2262.0 2263.0 2264.0 2265.0 2266.0 2267.0 2268.0 2269.0 2270.0 2271.0 2272.0 2273.0 2274.0 2275.0 2276.0 2277.0 2278.0 2279.0 2280.0 2281.0 2282.0 2283.0 2284.0 2285.0 2286.0 2287.0 2288.0 2289.0 2290.0 2291.0 2292.0 2293.0 2294.0 2295.0 2296.0 2297.0 2298.0 2299.0]</pre></td></tr><tr><th>Units</th><td style='text-align:left;'>year</td></tr></tbody></table>\n </td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n <tr>\n <th>values_at_bounds</th>\n <td style='text-align:left;'>\n <table><tbody>\n <tr>\n <th>values</th>\n <td style='text-align:left;'>\n <table><tbody><tr><th>Magnitude</th><td style='text-align:left;'><pre>[0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 120.0 121.0 122.0 123.0 124.0 125.0 126.0 127.0 128.0 129.0 130.0 131.0 132.0 133.0 134.0 135.0 136.0 137.0 138.0 139.0 140.0 141.0 142.0 143.0 144.0 145.0 146.0 147.0 148.0 149.0 150.0 151.0 152.0 153.0 154.0 155.0 156.0 157.0 158.0 159.0 160.0 161.0 162.0 163.0 164.0 165.0 166.0 167.0 168.0 169.0 170.0 171.0 172.0 173.0 174.0 175.0 176.0 177.0 178.0 179.0 180.0 181.0 182.0 183.0 184.0 185.0 186.0 187.0 188.0 189.0 190.0 191.0 192.0 193.0 194.0 195.0 196.0 197.0 198.0 199.0 200.0 201.0 202.0 203.0 204.0 205.0 206.0 207.0 208.0 209.0 210.0 211.0 212.0 213.0 214.0 215.0 216.0 217.0 218.0 219.0 220.0 221.0 222.0 223.0 224.0 225.0 226.0 227.0 228.0 229.0 230.0 231.0 232.0 233.0 234.0 235.0 236.0 237.0 238.0 239.0 240.0 241.0 242.0 243.0 244.0 245.0 246.0 247.0 248.0 249.0 250.0 251.0 252.0 253.0 254.0 255.0 256.0 257.0 258.0 259.0 260.0 261.0 262.0 263.0 264.0 265.0 266.0 267.0 268.0 269.0 270.0 271.0 272.0 273.0 274.0 275.0 276.0 277.0 278.0 279.0 280.0 281.0 282.0 283.0 284.0 285.0 286.0 287.0 288.0 289.0 290.0 291.0 292.0 293.0 294.0 295.0 296.0 297.0 298.0 299.0 300.0 301.0 302.0 303.0 304.0 305.0 306.0 307.0 308.0 309.0 310.0 311.0 312.0 313.0 314.0 315.0 316.0 317.0 318.0 319.0 320.0 321.0 322.0 323.0 324.0 325.0 326.0 327.0 328.0 329.0 330.0 331.0 332.0 333.0 334.0 335.0 336.0 337.0 338.0 339.0 340.0 341.0 342.0 343.0 344.0 345.0 346.0 347.0 348.0 349.0 350.0 351.0 352.0 353.0 354.0 355.0 356.0 357.0 358.0 359.0 360.0 361.0 362.0 363.0 364.0 365.0 366.0 367.0 368.0 369.0 370.0 371.0 372.0 373.0 374.0 375.0 376.0 377.0 378.0 379.0 380.0 381.0 382.0 383.0 384.0 385.0 386.0 387.0 388.0 389.0 390.0 391.0 392.0 393.0 394.0 395.0 396.0 397.0 398.0 399.0 400.0 401.0 402.0 403.0 404.0 405.0 406.0 407.0 408.0 409.0 410.0 411.0 412.0 413.0 414.0 415.0 416.0 417.0 418.0 419.0 420.0 421.0 422.0 423.0 424.0 425.0 426.0 427.0 428.0 429.0 430.0 431.0 432.0 433.0 434.0 435.0 436.0 437.0 438.0 439.0 440.0 441.0 442.0 443.0 444.0 445.0 446.0 447.0 448.0 449.0]</pre></td></tr><tr><th>Units</th><td style='text-align:left;'>meter</td></tr></tbody></table>\n </td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n </tbody></table>\n </div>\n </div>\n</div>"
really_long_ts._repr_html_()
"<div>\n <style>\n.continuous-timeseries-wrap {\n /*font-family: monospace;*/\n width: 540px;\n}\n\n.continuous-timeseries-header {\n padding: 6px 0 6px 3px;\n}\n\n.continuous-timeseries-header > div {\n display: inline;\n margin-top: 0;\n margin-bottom: 0;\n}\n\n.continuous-timeseries-cls {\n margin-left: 2px;\n margin-right: 10px;\n}\n\n.continuous-timeseries-cls {\n font-weight: bold;\n}\n </style>\n <div class='continuous-timeseries-wrap'>\n <div class='continuous-timeseries-header'>\n <div class='continuous-timeseries-cls'>continuous_timeseries.TimeseriesDiscrete</div>\n <table><tbody>\n <tr>\n <th>name</th>\n <td style='text-align:left;'>\n basic\n </td>\n </tr>\n <tr>\n <th>time_axis</th>\n <td style='text-align:left;'>\n <table><tbody>\n <tr>\n <th>bounds</th>\n <td style='text-align:left;'>\n <table><tbody><tr><th>Magnitude</th><td style='text-align:left;'><pre>[1850.0 1850.0833333333333 1850.1666666666665 ... 2299.7499999995907 2299.833333332924 2299.9166666662577]</pre></td></tr><tr><th>Units</th><td style='text-align:left;'>year</td></tr></tbody></table>\n </td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n <tr>\n <th>values_at_bounds</th>\n <td style='text-align:left;'>\n <table><tbody>\n <tr>\n <th>values</th>\n <td style='text-align:left;'>\n <table><tbody><tr><th>Magnitude</th><td style='text-align:left;'><pre>[0.0 1.0 2.0 ... 5397.0 5398.0 5399.0]</pre></td></tr><tr><th>Units</th><td style='text-align:left;'>meter</td></tr></tbody></table>\n </td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n </tbody></table>\n </div>\n </div>\n</div>"
Pretty representation¶
There is also the pretty representation,
which is used by the IPython pretty module
(https://ipython.readthedocs.io/en/8.26.0/api/generated/IPython.lib.pretty.html#module-IPython.lib.pretty,
not to be confused with the pprint module).
print(pretty(basic_ts))
TimeseriesDiscrete(
name='basic',
time_axis=TimeAxis(bounds=<Quantity([1750. 1850. 1950.], 'year')>),
values_at_bounds=ValuesAtBounds(values=<Quantity([1. 2. 3.], 'meter')>))
print(pretty(basic_ts.values_at_bounds))
ValuesAtBounds(values=<Quantity([1. 2. 3.], 'meter')>)
print(pretty(basic_ts.values_at_bounds.values))
<Quantity([1. 2. 3.], 'meter')>
print(pretty(long_ts))
TimeseriesDiscrete(
name='basic',
time_axis=TimeAxis(
bounds=<Quantity([1850. 1851. 1852. 1853. 1854. 1855. 1856. 1857. 1858. 1859. 1860. 1861.
1862. 1863. 1864. 1865. 1866. 1867. 1868. 1869. 1870. 1871. 1872. 1873.
1874. 1875. 1876. 1877. 1878. 1879. 1880. 1881. 1882. 1883. 1884. 1885.
1886. 1887. 1888. 1889. 1890. 1891. 1892. 1893. 1894. 1895. 1896. 1897.
1898. 1899. 1900. 1901. 1902. 1903. 1904. 1905. 1906. 1907. 1908. 1909.
1910. 1911. 1912. 1913. 1914. 1915. 1916. 1917. 1918. 1919. 1920. 1921.
1922. 1923. 1924. 1925. 1926. 1927. 1928. 1929. 1930. 1931. 1932. 1933.
1934. 1935. 1936. 1937. 1938. 1939. 1940. 1941. 1942. 1943. 1944. 1945.
1946. 1947. 1948. 1949. 1950. 1951. 1952. 1953. 1954. 1955. 1956. 1957.
1958. 1959. 1960. 1961. 1962. 1963. 1964. 1965. 1966. 1967. 1968. 1969.
1970. 1971. 1972. 1973. 1974. 1975. 1976. 1977. 1978. 1979. 1980. 1981.
1982. 1983. 1984. 1985. 1986. 1987. 1988. 1989. 1990. 1991. 1992. 1993.
1994. 1995. 1996. 1997. 1998. 1999. 2000. 2001. 2002. 2003. 2004. 2005.
2006. 2007. 2008. 2009. 2010. 2011. 2012. 2013. 2014. 2015. 2016. 2017.
2018. 2019. 2020. 2021. 2022. 2023. 2024. 2025. 2026. 2027. 2028. 2029.
2030. 2031. 2032. 2033. 2034. 2035. 2036. 2037. 2038. 2039. 2040. 2041.
2042. 2043. 2044. 2045. 2046. 2047. 2048. 2049. 2050. 2051. 2052. 2053.
2054. 2055. 2056. 2057. 2058. 2059. 2060. 2061. 2062. 2063. 2064. 2065.
2066. 2067. 2068. 2069. 2070. 2071. 2072. 2073. 2074. 2075. 2076. 2077.
2078. 2079. 2080. 2081. 2082. 2083. 2084. 2085. 2086. 2087. 2088. 2089.
2090. 2091. 2092. 2093. 2094. 2095. 2096. 2097. 2098. 2099. 2100. 2101.
2102. 2103. 2104. 2105. 2106. 2107. 2108. 2109. 2110. 2111. 2112. 2113.
2114. 2115. 2116. 2117. 2118. 2119. 2120. 2121. 2122. 2123. 2124. 2125.
2126. 2127. 2128. 2129. 2130. 2131. 2132. 2133. 2134. 2135. 2136. 2137.
2138. 2139. 2140. 2141. 2142. 2143. 2144. 2145. 2146. 2147. 2148. 2149.
2150. 2151. 2152. 2153. 2154. 2155. 2156. 2157. 2158. 2159. 2160. 2161.
2162. 2163. 2164. 2165. 2166. 2167. 2168. 2169. 2170. 2171. 2172. 2173.
2174. 2175. 2176. 2177. 2178. 2179. 2180. 2181. 2182. 2183. 2184. 2185.
2186. 2187. 2188. 2189. 2190. 2191. 2192. 2193. 2194. 2195. 2196. 2197.
2198. 2199. 2200. 2201. 2202. 2203. 2204. 2205. 2206. 2207. 2208. 2209.
2210. 2211. 2212. 2213. 2214. 2215. 2216. 2217. 2218. 2219. 2220. 2221.
2222. 2223. 2224. 2225. 2226. 2227. 2228. 2229. 2230. 2231. 2232. 2233.
2234. 2235. 2236. 2237. 2238. 2239. 2240. 2241. 2242. 2243. 2244. 2245.
2246. 2247. 2248. 2249. 2250. 2251. 2252. 2253. 2254. 2255. 2256. 2257.
2258. 2259. 2260. 2261. 2262. 2263. 2264. 2265. 2266. 2267. 2268. 2269.
2270. 2271. 2272. 2273. 2274. 2275. 2276. 2277. 2278. 2279. 2280. 2281.
2282. 2283. 2284. 2285. 2286. 2287. 2288. 2289. 2290. 2291. 2292. 2293.
2294. 2295. 2296. 2297. 2298. 2299.], 'year')>),
values_at_bounds=ValuesAtBounds(
values=<Quantity([ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.
14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27.
28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41.
42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55.
56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69.
70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83.
84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97.
98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111.
112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125.
126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139.
140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153.
154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166. 167.
168. 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. 179. 180. 181.
182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195.
196. 197. 198. 199. 200. 201. 202. 203. 204. 205. 206. 207. 208. 209.
210. 211. 212. 213. 214. 215. 216. 217. 218. 219. 220. 221. 222. 223.
224. 225. 226. 227. 228. 229. 230. 231. 232. 233. 234. 235. 236. 237.
238. 239. 240. 241. 242. 243. 244. 245. 246. 247. 248. 249. 250. 251.
252. 253. 254. 255. 256. 257. 258. 259. 260. 261. 262. 263. 264. 265.
266. 267. 268. 269. 270. 271. 272. 273. 274. 275. 276. 277. 278. 279.
280. 281. 282. 283. 284. 285. 286. 287. 288. 289. 290. 291. 292. 293.
294. 295. 296. 297. 298. 299. 300. 301. 302. 303. 304. 305. 306. 307.
308. 309. 310. 311. 312. 313. 314. 315. 316. 317. 318. 319. 320. 321.
322. 323. 324. 325. 326. 327. 328. 329. 330. 331. 332. 333. 334. 335.
336. 337. 338. 339. 340. 341. 342. 343. 344. 345. 346. 347. 348. 349.
350. 351. 352. 353. 354. 355. 356. 357. 358. 359. 360. 361. 362. 363.
364. 365. 366. 367. 368. 369. 370. 371. 372. 373. 374. 375. 376. 377.
378. 379. 380. 381. 382. 383. 384. 385. 386. 387. 388. 389. 390. 391.
392. 393. 394. 395. 396. 397. 398. 399. 400. 401. 402. 403. 404. 405.
406. 407. 408. 409. 410. 411. 412. 413. 414. 415. 416. 417. 418. 419.
420. 421. 422. 423. 424. 425. 426. 427. 428. 429. 430. 431. 432. 433.
434. 435. 436. 437. 438. 439. 440. 441. 442. 443. 444. 445. 446. 447.
448. 449.], 'meter')>))
print(pretty(really_long_ts))
TimeseriesDiscrete(
name='basic',
time_axis=TimeAxis(
bounds=<Quantity([1850. 1850.08333333 1850.16666667 ... 2299.75 2299.83333333
2299.91666667], 'year')>),
values_at_bounds=ValuesAtBounds(
values=<Quantity([0.000e+00 1.000e+00 2.000e+00 ... 5.397e+03 5.398e+03 5.399e+03], 'meter')>))
String representation¶
The string representations are intended for users. They are generally quite helpful. We let the underlying libraries handle most of the formatting decisions.
str(basic_ts)
'TimeseriesDiscrete(name=basic, time_axis=TimeAxis(bounds=[1750.0 1850.0 1950.0] year), values_at_bounds=ValuesAtBounds(values=[1.0 2.0 3.0] meter))'
The value displayed for the attributes of the object are simply the string representations of themselves.
str(basic_ts.values_at_bounds)
'ValuesAtBounds(values=[1.0 2.0 3.0] meter)'
str(basic_ts.values_at_bounds.values)
'[1.0 2.0 3.0] meter'
With a large array, this leads to the slightly odd behaviour of showing all the values, as shown below.
str(long_ts)
'TimeseriesDiscrete(name=basic, time_axis=TimeAxis(bounds=[1850.0 1851.0 1852.0 1853.0 1854.0 1855.0 1856.0 1857.0 1858.0 1859.0 1860.0 1861.0 1862.0 1863.0 1864.0 1865.0 1866.0 1867.0 1868.0 1869.0 1870.0 1871.0 1872.0 1873.0 1874.0 1875.0 1876.0 1877.0 1878.0 1879.0 1880.0 1881.0 1882.0 1883.0 1884.0 1885.0 1886.0 1887.0 1888.0 1889.0 1890.0 1891.0 1892.0 1893.0 1894.0 1895.0 1896.0 1897.0 1898.0 1899.0 1900.0 1901.0 1902.0 1903.0 1904.0 1905.0 1906.0 1907.0 1908.0 1909.0 1910.0 1911.0 1912.0 1913.0 1914.0 1915.0 1916.0 1917.0 1918.0 1919.0 1920.0 1921.0 1922.0 1923.0 1924.0 1925.0 1926.0 1927.0 1928.0 1929.0 1930.0 1931.0 1932.0 1933.0 1934.0 1935.0 1936.0 1937.0 1938.0 1939.0 1940.0 1941.0 1942.0 1943.0 1944.0 1945.0 1946.0 1947.0 1948.0 1949.0 1950.0 1951.0 1952.0 1953.0 1954.0 1955.0 1956.0 1957.0 1958.0 1959.0 1960.0 1961.0 1962.0 1963.0 1964.0 1965.0 1966.0 1967.0 1968.0 1969.0 1970.0 1971.0 1972.0 1973.0 1974.0 1975.0 1976.0 1977.0 1978.0 1979.0 1980.0 1981.0 1982.0 1983.0 1984.0 1985.0 1986.0 1987.0 1988.0 1989.0 1990.0 1991.0 1992.0 1993.0 1994.0 1995.0 1996.0 1997.0 1998.0 1999.0 2000.0 2001.0 2002.0 2003.0 2004.0 2005.0 2006.0 2007.0 2008.0 2009.0 2010.0 2011.0 2012.0 2013.0 2014.0 2015.0 2016.0 2017.0 2018.0 2019.0 2020.0 2021.0 2022.0 2023.0 2024.0 2025.0 2026.0 2027.0 2028.0 2029.0 2030.0 2031.0 2032.0 2033.0 2034.0 2035.0 2036.0 2037.0 2038.0 2039.0 2040.0 2041.0 2042.0 2043.0 2044.0 2045.0 2046.0 2047.0 2048.0 2049.0 2050.0 2051.0 2052.0 2053.0 2054.0 2055.0 2056.0 2057.0 2058.0 2059.0 2060.0 2061.0 2062.0 2063.0 2064.0 2065.0 2066.0 2067.0 2068.0 2069.0 2070.0 2071.0 2072.0 2073.0 2074.0 2075.0 2076.0 2077.0 2078.0 2079.0 2080.0 2081.0 2082.0 2083.0 2084.0 2085.0 2086.0 2087.0 2088.0 2089.0 2090.0 2091.0 2092.0 2093.0 2094.0 2095.0 2096.0 2097.0 2098.0 2099.0 2100.0 2101.0 2102.0 2103.0 2104.0 2105.0 2106.0 2107.0 2108.0 2109.0 2110.0 2111.0 2112.0 2113.0 2114.0 2115.0 2116.0 2117.0 2118.0 2119.0 2120.0 2121.0 2122.0 2123.0 2124.0 2125.0 2126.0 2127.0 2128.0 2129.0 2130.0 2131.0 2132.0 2133.0 2134.0 2135.0 2136.0 2137.0 2138.0 2139.0 2140.0 2141.0 2142.0 2143.0 2144.0 2145.0 2146.0 2147.0 2148.0 2149.0 2150.0 2151.0 2152.0 2153.0 2154.0 2155.0 2156.0 2157.0 2158.0 2159.0 2160.0 2161.0 2162.0 2163.0 2164.0 2165.0 2166.0 2167.0 2168.0 2169.0 2170.0 2171.0 2172.0 2173.0 2174.0 2175.0 2176.0 2177.0 2178.0 2179.0 2180.0 2181.0 2182.0 2183.0 2184.0 2185.0 2186.0 2187.0 2188.0 2189.0 2190.0 2191.0 2192.0 2193.0 2194.0 2195.0 2196.0 2197.0 2198.0 2199.0 2200.0 2201.0 2202.0 2203.0 2204.0 2205.0 2206.0 2207.0 2208.0 2209.0 2210.0 2211.0 2212.0 2213.0 2214.0 2215.0 2216.0 2217.0 2218.0 2219.0 2220.0 2221.0 2222.0 2223.0 2224.0 2225.0 2226.0 2227.0 2228.0 2229.0 2230.0 2231.0 2232.0 2233.0 2234.0 2235.0 2236.0 2237.0 2238.0 2239.0 2240.0 2241.0 2242.0 2243.0 2244.0 2245.0 2246.0 2247.0 2248.0 2249.0 2250.0 2251.0 2252.0 2253.0 2254.0 2255.0 2256.0 2257.0 2258.0 2259.0 2260.0 2261.0 2262.0 2263.0 2264.0 2265.0 2266.0 2267.0 2268.0 2269.0 2270.0 2271.0 2272.0 2273.0 2274.0 2275.0 2276.0 2277.0 2278.0 2279.0 2280.0 2281.0 2282.0 2283.0 2284.0 2285.0 2286.0 2287.0 2288.0 2289.0 2290.0 2291.0 2292.0 2293.0 2294.0 2295.0 2296.0 2297.0 2298.0 2299.0] year), values_at_bounds=ValuesAtBounds(values=[0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 120.0 121.0 122.0 123.0 124.0 125.0 126.0 127.0 128.0 129.0 130.0 131.0 132.0 133.0 134.0 135.0 136.0 137.0 138.0 139.0 140.0 141.0 142.0 143.0 144.0 145.0 146.0 147.0 148.0 149.0 150.0 151.0 152.0 153.0 154.0 155.0 156.0 157.0 158.0 159.0 160.0 161.0 162.0 163.0 164.0 165.0 166.0 167.0 168.0 169.0 170.0 171.0 172.0 173.0 174.0 175.0 176.0 177.0 178.0 179.0 180.0 181.0 182.0 183.0 184.0 185.0 186.0 187.0 188.0 189.0 190.0 191.0 192.0 193.0 194.0 195.0 196.0 197.0 198.0 199.0 200.0 201.0 202.0 203.0 204.0 205.0 206.0 207.0 208.0 209.0 210.0 211.0 212.0 213.0 214.0 215.0 216.0 217.0 218.0 219.0 220.0 221.0 222.0 223.0 224.0 225.0 226.0 227.0 228.0 229.0 230.0 231.0 232.0 233.0 234.0 235.0 236.0 237.0 238.0 239.0 240.0 241.0 242.0 243.0 244.0 245.0 246.0 247.0 248.0 249.0 250.0 251.0 252.0 253.0 254.0 255.0 256.0 257.0 258.0 259.0 260.0 261.0 262.0 263.0 264.0 265.0 266.0 267.0 268.0 269.0 270.0 271.0 272.0 273.0 274.0 275.0 276.0 277.0 278.0 279.0 280.0 281.0 282.0 283.0 284.0 285.0 286.0 287.0 288.0 289.0 290.0 291.0 292.0 293.0 294.0 295.0 296.0 297.0 298.0 299.0 300.0 301.0 302.0 303.0 304.0 305.0 306.0 307.0 308.0 309.0 310.0 311.0 312.0 313.0 314.0 315.0 316.0 317.0 318.0 319.0 320.0 321.0 322.0 323.0 324.0 325.0 326.0 327.0 328.0 329.0 330.0 331.0 332.0 333.0 334.0 335.0 336.0 337.0 338.0 339.0 340.0 341.0 342.0 343.0 344.0 345.0 346.0 347.0 348.0 349.0 350.0 351.0 352.0 353.0 354.0 355.0 356.0 357.0 358.0 359.0 360.0 361.0 362.0 363.0 364.0 365.0 366.0 367.0 368.0 369.0 370.0 371.0 372.0 373.0 374.0 375.0 376.0 377.0 378.0 379.0 380.0 381.0 382.0 383.0 384.0 385.0 386.0 387.0 388.0 389.0 390.0 391.0 392.0 393.0 394.0 395.0 396.0 397.0 398.0 399.0 400.0 401.0 402.0 403.0 404.0 405.0 406.0 407.0 408.0 409.0 410.0 411.0 412.0 413.0 414.0 415.0 416.0 417.0 418.0 419.0 420.0 421.0 422.0 423.0 424.0 425.0 426.0 427.0 428.0 429.0 430.0 431.0 432.0 433.0 434.0 435.0 436.0 437.0 438.0 439.0 440.0 441.0 442.0 443.0 444.0 445.0 446.0 447.0 448.0 449.0] meter))'
For whatever reason, this is the behaviour of the underlying packages.
str(long_ts.values_at_bounds.values)
'[0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 120.0 121.0 122.0 123.0 124.0 125.0 126.0 127.0 128.0 129.0 130.0 131.0 132.0 133.0 134.0 135.0 136.0 137.0 138.0 139.0 140.0 141.0 142.0 143.0 144.0 145.0 146.0 147.0 148.0 149.0 150.0 151.0 152.0 153.0 154.0 155.0 156.0 157.0 158.0 159.0 160.0 161.0 162.0 163.0 164.0 165.0 166.0 167.0 168.0 169.0 170.0 171.0 172.0 173.0 174.0 175.0 176.0 177.0 178.0 179.0 180.0 181.0 182.0 183.0 184.0 185.0 186.0 187.0 188.0 189.0 190.0 191.0 192.0 193.0 194.0 195.0 196.0 197.0 198.0 199.0 200.0 201.0 202.0 203.0 204.0 205.0 206.0 207.0 208.0 209.0 210.0 211.0 212.0 213.0 214.0 215.0 216.0 217.0 218.0 219.0 220.0 221.0 222.0 223.0 224.0 225.0 226.0 227.0 228.0 229.0 230.0 231.0 232.0 233.0 234.0 235.0 236.0 237.0 238.0 239.0 240.0 241.0 242.0 243.0 244.0 245.0 246.0 247.0 248.0 249.0 250.0 251.0 252.0 253.0 254.0 255.0 256.0 257.0 258.0 259.0 260.0 261.0 262.0 263.0 264.0 265.0 266.0 267.0 268.0 269.0 270.0 271.0 272.0 273.0 274.0 275.0 276.0 277.0 278.0 279.0 280.0 281.0 282.0 283.0 284.0 285.0 286.0 287.0 288.0 289.0 290.0 291.0 292.0 293.0 294.0 295.0 296.0 297.0 298.0 299.0 300.0 301.0 302.0 303.0 304.0 305.0 306.0 307.0 308.0 309.0 310.0 311.0 312.0 313.0 314.0 315.0 316.0 317.0 318.0 319.0 320.0 321.0 322.0 323.0 324.0 325.0 326.0 327.0 328.0 329.0 330.0 331.0 332.0 333.0 334.0 335.0 336.0 337.0 338.0 339.0 340.0 341.0 342.0 343.0 344.0 345.0 346.0 347.0 348.0 349.0 350.0 351.0 352.0 353.0 354.0 355.0 356.0 357.0 358.0 359.0 360.0 361.0 362.0 363.0 364.0 365.0 366.0 367.0 368.0 369.0 370.0 371.0 372.0 373.0 374.0 375.0 376.0 377.0 378.0 379.0 380.0 381.0 382.0 383.0 384.0 385.0 386.0 387.0 388.0 389.0 390.0 391.0 392.0 393.0 394.0 395.0 396.0 397.0 398.0 399.0 400.0 401.0 402.0 403.0 404.0 405.0 406.0 407.0 408.0 409.0 410.0 411.0 412.0 413.0 414.0 415.0 416.0 417.0 418.0 419.0 420.0 421.0 422.0 423.0 424.0 425.0 426.0 427.0 428.0 429.0 430.0 431.0 432.0 433.0 434.0 435.0 436.0 437.0 438.0 439.0 440.0 441.0 442.0 443.0 444.0 445.0 446.0 447.0 448.0 449.0] meter'
If we go to an even larger array, not all values are shown (which seems a more sensible choice to us).
str(really_long_ts)
'TimeseriesDiscrete(name=basic, time_axis=TimeAxis(bounds=[1850.0 1850.0833333333333 1850.1666666666665 ... 2299.7499999995907 2299.833333332924 2299.9166666662577] year), values_at_bounds=ValuesAtBounds(values=[0.0 1.0 2.0 ... 5397.0 5398.0 5399.0] meter))'
str(really_long_ts.values_at_bounds.values)
'[0.0 1.0 2.0 ... 5397.0 5398.0 5399.0] meter'
repr representation¶
The repr representation (which internally calls the __repr__ method)
is intended for developers,
i.e. to allow cutting and pasting the output into Python directly
(although neither numpy nor pint follows this exactly in all cases,
and we don't try to change/fix this, their developers know better than us).
As a result, it can be quite unwieldy.
repr(basic_ts)
"TimeseriesDiscrete(name='basic', time_axis=TimeAxis(bounds=<Quantity([1750. 1850. 1950.], 'year')>), values_at_bounds=ValuesAtBounds(values=<Quantity([1. 2. 3.], 'meter')>))"
repr(basic_ts.values_at_bounds)
"ValuesAtBounds(values=<Quantity([1. 2. 3.], 'meter')>)"
# pint's output is not copy-pasteable because of the surrounding "<>"
# and lack of commas between numerical values.
repr(basic_ts.values_at_bounds.values)
"<Quantity([1. 2. 3.], 'meter')>"
# numpy does give copy-pasteable output for basic arrays
repr(basic_ts.values_at_bounds.values.m)
'array([1., 2., 3.])'
repr(long_ts)
"TimeseriesDiscrete(name='basic', time_axis=TimeAxis(bounds=<Quantity([1850. 1851. 1852. 1853. 1854. 1855. 1856. 1857. 1858. 1859. 1860. 1861.\n 1862. 1863. 1864. 1865. 1866. 1867. 1868. 1869. 1870. 1871. 1872. 1873.\n 1874. 1875. 1876. 1877. 1878. 1879. 1880. 1881. 1882. 1883. 1884. 1885.\n 1886. 1887. 1888. 1889. 1890. 1891. 1892. 1893. 1894. 1895. 1896. 1897.\n 1898. 1899. 1900. 1901. 1902. 1903. 1904. 1905. 1906. 1907. 1908. 1909.\n 1910. 1911. 1912. 1913. 1914. 1915. 1916. 1917. 1918. 1919. 1920. 1921.\n 1922. 1923. 1924. 1925. 1926. 1927. 1928. 1929. 1930. 1931. 1932. 1933.\n 1934. 1935. 1936. 1937. 1938. 1939. 1940. 1941. 1942. 1943. 1944. 1945.\n 1946. 1947. 1948. 1949. 1950. 1951. 1952. 1953. 1954. 1955. 1956. 1957.\n 1958. 1959. 1960. 1961. 1962. 1963. 1964. 1965. 1966. 1967. 1968. 1969.\n 1970. 1971. 1972. 1973. 1974. 1975. 1976. 1977. 1978. 1979. 1980. 1981.\n 1982. 1983. 1984. 1985. 1986. 1987. 1988. 1989. 1990. 1991. 1992. 1993.\n 1994. 1995. 1996. 1997. 1998. 1999. 2000. 2001. 2002. 2003. 2004. 2005.\n 2006. 2007. 2008. 2009. 2010. 2011. 2012. 2013. 2014. 2015. 2016. 2017.\n 2018. 2019. 2020. 2021. 2022. 2023. 2024. 2025. 2026. 2027. 2028. 2029.\n 2030. 2031. 2032. 2033. 2034. 2035. 2036. 2037. 2038. 2039. 2040. 2041.\n 2042. 2043. 2044. 2045. 2046. 2047. 2048. 2049. 2050. 2051. 2052. 2053.\n 2054. 2055. 2056. 2057. 2058. 2059. 2060. 2061. 2062. 2063. 2064. 2065.\n 2066. 2067. 2068. 2069. 2070. 2071. 2072. 2073. 2074. 2075. 2076. 2077.\n 2078. 2079. 2080. 2081. 2082. 2083. 2084. 2085. 2086. 2087. 2088. 2089.\n 2090. 2091. 2092. 2093. 2094. 2095. 2096. 2097. 2098. 2099. 2100. 2101.\n 2102. 2103. 2104. 2105. 2106. 2107. 2108. 2109. 2110. 2111. 2112. 2113.\n 2114. 2115. 2116. 2117. 2118. 2119. 2120. 2121. 2122. 2123. 2124. 2125.\n 2126. 2127. 2128. 2129. 2130. 2131. 2132. 2133. 2134. 2135. 2136. 2137.\n 2138. 2139. 2140. 2141. 2142. 2143. 2144. 2145. 2146. 2147. 2148. 2149.\n 2150. 2151. 2152. 2153. 2154. 2155. 2156. 2157. 2158. 2159. 2160. 2161.\n 2162. 2163. 2164. 2165. 2166. 2167. 2168. 2169. 2170. 2171. 2172. 2173.\n 2174. 2175. 2176. 2177. 2178. 2179. 2180. 2181. 2182. 2183. 2184. 2185.\n 2186. 2187. 2188. 2189. 2190. 2191. 2192. 2193. 2194. 2195. 2196. 2197.\n 2198. 2199. 2200. 2201. 2202. 2203. 2204. 2205. 2206. 2207. 2208. 2209.\n 2210. 2211. 2212. 2213. 2214. 2215. 2216. 2217. 2218. 2219. 2220. 2221.\n 2222. 2223. 2224. 2225. 2226. 2227. 2228. 2229. 2230. 2231. 2232. 2233.\n 2234. 2235. 2236. 2237. 2238. 2239. 2240. 2241. 2242. 2243. 2244. 2245.\n 2246. 2247. 2248. 2249. 2250. 2251. 2252. 2253. 2254. 2255. 2256. 2257.\n 2258. 2259. 2260. 2261. 2262. 2263. 2264. 2265. 2266. 2267. 2268. 2269.\n 2270. 2271. 2272. 2273. 2274. 2275. 2276. 2277. 2278. 2279. 2280. 2281.\n 2282. 2283. 2284. 2285. 2286. 2287. 2288. 2289. 2290. 2291. 2292. 2293.\n 2294. 2295. 2296. 2297. 2298. 2299.], 'year')>), values_at_bounds=ValuesAtBounds(values=<Quantity([ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.\n 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27.\n 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41.\n 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55.\n 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69.\n 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83.\n 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97.\n 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111.\n 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125.\n 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139.\n 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153.\n 154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166. 167.\n 168. 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. 179. 180. 181.\n 182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195.\n 196. 197. 198. 199. 200. 201. 202. 203. 204. 205. 206. 207. 208. 209.\n 210. 211. 212. 213. 214. 215. 216. 217. 218. 219. 220. 221. 222. 223.\n 224. 225. 226. 227. 228. 229. 230. 231. 232. 233. 234. 235. 236. 237.\n 238. 239. 240. 241. 242. 243. 244. 245. 246. 247. 248. 249. 250. 251.\n 252. 253. 254. 255. 256. 257. 258. 259. 260. 261. 262. 263. 264. 265.\n 266. 267. 268. 269. 270. 271. 272. 273. 274. 275. 276. 277. 278. 279.\n 280. 281. 282. 283. 284. 285. 286. 287. 288. 289. 290. 291. 292. 293.\n 294. 295. 296. 297. 298. 299. 300. 301. 302. 303. 304. 305. 306. 307.\n 308. 309. 310. 311. 312. 313. 314. 315. 316. 317. 318. 319. 320. 321.\n 322. 323. 324. 325. 326. 327. 328. 329. 330. 331. 332. 333. 334. 335.\n 336. 337. 338. 339. 340. 341. 342. 343. 344. 345. 346. 347. 348. 349.\n 350. 351. 352. 353. 354. 355. 356. 357. 358. 359. 360. 361. 362. 363.\n 364. 365. 366. 367. 368. 369. 370. 371. 372. 373. 374. 375. 376. 377.\n 378. 379. 380. 381. 382. 383. 384. 385. 386. 387. 388. 389. 390. 391.\n 392. 393. 394. 395. 396. 397. 398. 399. 400. 401. 402. 403. 404. 405.\n 406. 407. 408. 409. 410. 411. 412. 413. 414. 415. 416. 417. 418. 419.\n 420. 421. 422. 423. 424. 425. 426. 427. 428. 429. 430. 431. 432. 433.\n 434. 435. 436. 437. 438. 439. 440. 441. 442. 443. 444. 445. 446. 447.\n 448. 449.], 'meter')>))"
repr(really_long_ts)
"TimeseriesDiscrete(name='basic', time_axis=TimeAxis(bounds=<Quantity([1850. 1850.08333333 1850.16666667 ... 2299.75 2299.83333333\n 2299.91666667], 'year')>), values_at_bounds=ValuesAtBounds(values=<Quantity([0.000e+00 1.000e+00 2.000e+00 ... 5.397e+03 5.398e+03 5.399e+03], 'meter')>))"
# numpy doesn't give copy-pasteable output for really large arrays
repr(really_long_ts.values_at_bounds.values.m)
'array([0.000e+00, 1.000e+00, 2.000e+00, ..., 5.397e+03, 5.398e+03,\n 5.399e+03], shape=(5400,))'