diff --git a/vllm/lib/python3.10/site-packages/openpyxl/__pycache__/__init__.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2aaa33f583811fb341fc5378b8cc8e113e6cd19d Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/__pycache__/__init__.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/__pycache__/_constants.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/__pycache__/_constants.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e469fdd180cd98c83b6e7748e49e7f75d14652a Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/__pycache__/_constants.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/_3d.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/_3d.py new file mode 100644 index 0000000000000000000000000000000000000000..1651a993301cda4879faa4b33f83cc28c1135069 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/_3d.py @@ -0,0 +1,105 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors import Typed, Alias +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors.nested import ( + NestedBool, + NestedInteger, + NestedMinMax, +) +from openpyxl.descriptors.excel import ExtensionList +from .marker import PictureOptions +from .shapes import GraphicalProperties + + +class View3D(Serialisable): + + tagname = "view3D" + + rotX = NestedMinMax(min=-90, max=90, allow_none=True) + x_rotation = Alias('rotX') + hPercent = NestedMinMax(min=5, max=500, allow_none=True) + height_percent = Alias('hPercent') + rotY = NestedInteger(min=-90, max=90, allow_none=True) + y_rotation = Alias('rotY') + depthPercent = NestedInteger(allow_none=True) + rAngAx = NestedBool(allow_none=True) + right_angle_axes = Alias('rAngAx') + perspective = NestedInteger(allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('rotX', 'hPercent', 'rotY', 'depthPercent', 'rAngAx', + 'perspective',) + + def __init__(self, + rotX=15, + hPercent=None, + rotY=20, + depthPercent=None, + rAngAx=True, + perspective=None, + extLst=None, + ): + self.rotX = rotX + self.hPercent = hPercent + self.rotY = rotY + self.depthPercent = depthPercent + self.rAngAx = rAngAx + self.perspective = perspective + + +class Surface(Serialisable): + + tagname = "surface" + + thickness = NestedInteger(allow_none=True) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias('spPr') + pictureOptions = Typed(expected_type=PictureOptions, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('thickness', 'spPr', 'pictureOptions',) + + def __init__(self, + thickness=None, + spPr=None, + pictureOptions=None, + extLst=None, + ): + self.thickness = thickness + self.spPr = spPr + self.pictureOptions = pictureOptions + + +class _3DBase(Serialisable): + + """ + Base class for 3D charts + """ + + tagname = "ChartBase" + + view3D = Typed(expected_type=View3D, allow_none=True) + floor = Typed(expected_type=Surface, allow_none=True) + sideWall = Typed(expected_type=Surface, allow_none=True) + backWall = Typed(expected_type=Surface, allow_none=True) + + def __init__(self, + view3D=None, + floor=None, + sideWall=None, + backWall=None, + ): + if view3D is None: + view3D = View3D() + self.view3D = view3D + if floor is None: + floor = Surface() + self.floor = floor + if sideWall is None: + sideWall = Surface() + self.sideWall = sideWall + if backWall is None: + backWall = Surface() + self.backWall = backWall + super(_3DBase, self).__init__() diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__init__.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ecc4d8bf51447d4dd36efcb8a966559b8307666f --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/__init__.py @@ -0,0 +1,19 @@ +# Copyright (c) 2010-2024 openpyxl + +from .area_chart import AreaChart, AreaChart3D +from .bar_chart import BarChart, BarChart3D +from .bubble_chart import BubbleChart +from .line_chart import LineChart, LineChart3D +from .pie_chart import ( + PieChart, + PieChart3D, + DoughnutChart, + ProjectedPieChart +) +from .radar_chart import RadarChart +from .scatter_chart import ScatterChart +from .stock_chart import StockChart +from .surface_chart import SurfaceChart, SurfaceChart3D + +from .series_factory import SeriesFactory as Series +from .reference import Reference diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/_3d.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/_3d.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ac906d7a1b2d8e72fbd4bbfc5cf146786f5b977 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/_3d.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/__init__.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b04af1b91ceb2b2b2f441cd1c18092ad77950ad6 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/__init__.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/_chart.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/_chart.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66b8db1a678bcc123c0e64a26a1b09176e1408ab Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/_chart.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/chartspace.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/chartspace.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fba109075b9276df7a8bad4a300507c2be93518 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/chartspace.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/label.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/label.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8b512da8928cc3b5ed42a0e962de0f0ef48a323d Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/label.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/legend.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/legend.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8efca4c09ef12f3bf7f596952574bc8170be1ac Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/legend.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/marker.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/marker.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6302d1c58b114610d153e29c964548605650d36 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/marker.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/radar_chart.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/radar_chart.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..37498c5275535a093edae5a0402b7fa84c5e6e3a Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/radar_chart.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/series.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/series.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f703efda11f4cc9e9e1bb24c61988f45ad589fd5 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/series.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/stock_chart.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/stock_chart.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ad928e57c66859d07dc33ab7b3cfd654ad194a8 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/stock_chart.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/surface_chart.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/surface_chart.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..438aba70ccff21126d90e01580cf35f59f1aa700 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/chart/__pycache__/surface_chart.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/_chart.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..6a613546a83507d90b4554c9bf32a623f6b36888 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/_chart.py @@ -0,0 +1,199 @@ +# Copyright (c) 2010-2024 openpyxl + +from collections import OrderedDict +from operator import attrgetter + +from openpyxl.descriptors import ( + Typed, + Integer, + Alias, + MinMax, + Bool, + Set, +) +from openpyxl.descriptors.sequence import ValueSequence +from openpyxl.descriptors.serialisable import Serialisable + +from ._3d import _3DBase +from .data_source import AxDataSource, NumRef +from .layout import Layout +from .legend import Legend +from .reference import Reference +from .series_factory import SeriesFactory +from .series import attribute_mapping +from .shapes import GraphicalProperties +from .title import TitleDescriptor + +class AxId(Serialisable): + + val = Integer() + + def __init__(self, val): + self.val = val + + +def PlotArea(): + from .chartspace import PlotArea + return PlotArea() + + +class ChartBase(Serialisable): + + """ + Base class for all charts + """ + + legend = Typed(expected_type=Legend, allow_none=True) + layout = Typed(expected_type=Layout, allow_none=True) + roundedCorners = Bool(allow_none=True) + axId = ValueSequence(expected_type=int) + visible_cells_only = Bool(allow_none=True) + display_blanks = Set(values=['span', 'gap', 'zero']) + graphical_properties = Typed(expected_type=GraphicalProperties, allow_none=True) + + _series_type = "" + ser = () + series = Alias('ser') + title = TitleDescriptor() + anchor = "E15" # default anchor position + width = 15 # in cm, approx 5 rows + height = 7.5 # in cm, approx 14 rows + _id = 1 + _path = "/xl/charts/chart{0}.xml" + style = MinMax(allow_none=True, min=1, max=48) + mime_type = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml" + graphical_properties = Typed(expected_type=GraphicalProperties, allow_none=True) # mapped to chartspace + + __elements__ = () + + + def __init__(self, axId=(), **kw): + self._charts = [self] + self.title = None + self.layout = None + self.roundedCorners = None + self.legend = Legend() + self.graphical_properties = None + self.style = None + self.plot_area = PlotArea() + self.axId = axId + self.display_blanks = 'gap' + self.pivotSource = None + self.pivotFormats = () + self.visible_cells_only = True + self.idx_base = 0 + self.graphical_properties = None + super().__init__() + + + def __hash__(self): + """ + Just need to check for identity + """ + return id(self) + + def __iadd__(self, other): + """ + Combine the chart with another one + """ + if not isinstance(other, ChartBase): + raise TypeError("Only other charts can be added") + self._charts.append(other) + return self + + + def to_tree(self, namespace=None, tagname=None, idx=None): + self.axId = [id for id in self._axes] + if self.ser is not None: + for s in self.ser: + s.__elements__ = attribute_mapping[self._series_type] + return super().to_tree(tagname, idx) + + + def _reindex(self): + """ + Normalise and rebase series: sort by order and then rebase order + + """ + # sort data series in order and rebase + ds = sorted(self.series, key=attrgetter("order")) + for idx, s in enumerate(ds): + s.order = idx + self.series = ds + + + def _write(self): + from .chartspace import ChartSpace, ChartContainer + self.plot_area.layout = self.layout + + idx_base = self.idx_base + for chart in self._charts: + if chart not in self.plot_area._charts: + chart.idx_base = idx_base + idx_base += len(chart.series) + self.plot_area._charts = self._charts + + container = ChartContainer(plotArea=self.plot_area, legend=self.legend, title=self.title) + if isinstance(chart, _3DBase): + container.view3D = chart.view3D + container.floor = chart.floor + container.sideWall = chart.sideWall + container.backWall = chart.backWall + container.plotVisOnly = self.visible_cells_only + container.dispBlanksAs = self.display_blanks + container.pivotFmts = self.pivotFormats + cs = ChartSpace(chart=container) + cs.style = self.style + cs.roundedCorners = self.roundedCorners + cs.pivotSource = self.pivotSource + cs.spPr = self.graphical_properties + return cs.to_tree() + + + @property + def _axes(self): + x = getattr(self, "x_axis", None) + y = getattr(self, "y_axis", None) + z = getattr(self, "z_axis", None) + return OrderedDict([(axis.axId, axis) for axis in (x, y, z) if axis]) + + + def set_categories(self, labels): + """ + Set the categories / x-axis values + """ + if not isinstance(labels, Reference): + labels = Reference(range_string=labels) + for s in self.ser: + s.cat = AxDataSource(numRef=NumRef(f=labels)) + + + def add_data(self, data, from_rows=False, titles_from_data=False): + """ + Add a range of data in a single pass. + The default is to treat each column as a data series. + """ + if not isinstance(data, Reference): + data = Reference(range_string=data) + + if from_rows: + values = data.rows + + else: + values = data.cols + + for ref in values: + series = SeriesFactory(ref, title_from_data=titles_from_data) + self.series.append(series) + + + def append(self, value): + """Append a data series to the chart""" + l = self.series[:] + l.append(value) + self.series = l + + + @property + def path(self): + return self._path.format(self._id) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/area_chart.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/area_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..d3d9808509cf6f0636bbcf34d0337e7f9c5d188d --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/area_chart.py @@ -0,0 +1,106 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Set, + Bool, + Integer, + Sequence, + Alias, +) + +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedMinMax, + NestedSet, + NestedBool, +) + +from ._chart import ChartBase +from .descriptors import NestedGapAmount +from .axis import TextAxis, NumericAxis, SeriesAxis, ChartLines +from .label import DataLabelList +from .series import Series + + +class _AreaChartBase(ChartBase): + + grouping = NestedSet(values=(['percentStacked', 'standard', 'stacked'])) + varyColors = NestedBool(nested=True, allow_none=True) + ser = Sequence(expected_type=Series, allow_none=True) + dLbls = Typed(expected_type=DataLabelList, allow_none=True) + dataLabels = Alias("dLbls") + dropLines = Typed(expected_type=ChartLines, allow_none=True) + + _series_type = "area" + + __elements__ = ('grouping', 'varyColors', 'ser', 'dLbls', 'dropLines') + + def __init__(self, + grouping="standard", + varyColors=None, + ser=(), + dLbls=None, + dropLines=None, + ): + self.grouping = grouping + self.varyColors = varyColors + self.ser = ser + self.dLbls = dLbls + self.dropLines = dropLines + super().__init__() + + +class AreaChart(_AreaChartBase): + + tagname = "areaChart" + + grouping = _AreaChartBase.grouping + varyColors = _AreaChartBase.varyColors + ser = _AreaChartBase.ser + dLbls = _AreaChartBase.dLbls + dropLines = _AreaChartBase.dropLines + + # chart properties actually used by containing classes + x_axis = Typed(expected_type=TextAxis) + y_axis = Typed(expected_type=NumericAxis) + + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = _AreaChartBase.__elements__ + ('axId',) + + def __init__(self, + axId=None, + extLst=None, + **kw + ): + self.x_axis = TextAxis() + self.y_axis = NumericAxis() + super().__init__(**kw) + + +class AreaChart3D(AreaChart): + + tagname = "area3DChart" + + grouping = _AreaChartBase.grouping + varyColors = _AreaChartBase.varyColors + ser = _AreaChartBase.ser + dLbls = _AreaChartBase.dLbls + dropLines = _AreaChartBase.dropLines + + gapDepth = NestedGapAmount() + + x_axis = Typed(expected_type=TextAxis) + y_axis = Typed(expected_type=NumericAxis) + z_axis = Typed(expected_type=SeriesAxis, allow_none=True) + + __elements__ = AreaChart.__elements__ + ('gapDepth', ) + + def __init__(self, gapDepth=None, **kw): + self.gapDepth = gapDepth + super(AreaChart3D, self).__init__(**kw) + self.x_axis = TextAxis() + self.y_axis = NumericAxis() + self.z_axis = SeriesAxis() diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/axis.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/axis.py new file mode 100644 index 0000000000000000000000000000000000000000..7e99416c0737d71c8817ed129835a8add16f3def --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/axis.py @@ -0,0 +1,401 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Float, + NoneSet, + Bool, + Integer, + MinMax, + NoneSet, + Set, + String, + Alias, +) + +from openpyxl.descriptors.excel import ( + ExtensionList, + Percentage, + _explicit_none, +) +from openpyxl.descriptors.nested import ( + NestedValue, + NestedSet, + NestedBool, + NestedNoneSet, + NestedFloat, + NestedInteger, + NestedMinMax, +) +from openpyxl.xml.constants import CHART_NS + +from .descriptors import NumberFormatDescriptor +from .layout import Layout +from .text import Text, RichText +from .shapes import GraphicalProperties +from .title import Title, TitleDescriptor + + +class ChartLines(Serialisable): + + tagname = "chartLines" + + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias('spPr') + + def __init__(self, spPr=None): + self.spPr = spPr + + +class Scaling(Serialisable): + + tagname = "scaling" + + logBase = NestedFloat(allow_none=True) + orientation = NestedSet(values=(['maxMin', 'minMax'])) + max = NestedFloat(allow_none=True) + min = NestedFloat(allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('logBase', 'orientation', 'max', 'min',) + + def __init__(self, + logBase=None, + orientation="minMax", + max=None, + min=None, + extLst=None, + ): + self.logBase = logBase + self.orientation = orientation + self.max = max + self.min = min + + +class _BaseAxis(Serialisable): + + axId = NestedInteger(expected_type=int) + scaling = Typed(expected_type=Scaling) + delete = NestedBool(allow_none=True) + axPos = NestedSet(values=(['b', 'l', 'r', 't'])) + majorGridlines = Typed(expected_type=ChartLines, allow_none=True) + minorGridlines = Typed(expected_type=ChartLines, allow_none=True) + title = TitleDescriptor() + numFmt = NumberFormatDescriptor() + number_format = Alias("numFmt") + majorTickMark = NestedNoneSet(values=(['cross', 'in', 'out']), to_tree=_explicit_none) + minorTickMark = NestedNoneSet(values=(['cross', 'in', 'out']), to_tree=_explicit_none) + tickLblPos = NestedNoneSet(values=(['high', 'low', 'nextTo'])) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias('spPr') + txPr = Typed(expected_type=RichText, allow_none=True) + textProperties = Alias('txPr') + crossAx = NestedInteger(expected_type=int) # references other axis + crosses = NestedNoneSet(values=(['autoZero', 'max', 'min'])) + crossesAt = NestedFloat(allow_none=True) + + # crosses & crossesAt are mutually exclusive + + __elements__ = ('axId', 'scaling', 'delete', 'axPos', 'majorGridlines', + 'minorGridlines', 'title', 'numFmt', 'majorTickMark', 'minorTickMark', + 'tickLblPos', 'spPr', 'txPr', 'crossAx', 'crosses', 'crossesAt') + + def __init__(self, + axId=None, + scaling=None, + delete=None, + axPos='l', + majorGridlines=None, + minorGridlines=None, + title=None, + numFmt=None, + majorTickMark=None, + minorTickMark=None, + tickLblPos=None, + spPr=None, + txPr= None, + crossAx=None, + crosses=None, + crossesAt=None, + ): + self.axId = axId + if scaling is None: + scaling = Scaling() + self.scaling = scaling + self.delete = delete + self.axPos = axPos + self.majorGridlines = majorGridlines + self.minorGridlines = minorGridlines + self.title = title + self.numFmt = numFmt + self.majorTickMark = majorTickMark + self.minorTickMark = minorTickMark + self.tickLblPos = tickLblPos + self.spPr = spPr + self.txPr = txPr + self.crossAx = crossAx + self.crosses = crosses + self.crossesAt = crossesAt + + +class DisplayUnitsLabel(Serialisable): + + tagname = "dispUnitsLbl" + + layout = Typed(expected_type=Layout, allow_none=True) + tx = Typed(expected_type=Text, allow_none=True) + text = Alias("tx") + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias("spPr") + txPr = Typed(expected_type=RichText, allow_none=True) + textPropertes = Alias("txPr") + + __elements__ = ('layout', 'tx', 'spPr', 'txPr') + + def __init__(self, + layout=None, + tx=None, + spPr=None, + txPr=None, + ): + self.layout = layout + self.tx = tx + self.spPr = spPr + self.txPr = txPr + + +class DisplayUnitsLabelList(Serialisable): + + tagname = "dispUnits" + + custUnit = NestedFloat(allow_none=True) + builtInUnit = NestedNoneSet(values=(['hundreds', 'thousands', + 'tenThousands', 'hundredThousands', 'millions', 'tenMillions', + 'hundredMillions', 'billions', 'trillions'])) + dispUnitsLbl = Typed(expected_type=DisplayUnitsLabel, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('custUnit', 'builtInUnit', 'dispUnitsLbl',) + + def __init__(self, + custUnit=None, + builtInUnit=None, + dispUnitsLbl=None, + extLst=None, + ): + self.custUnit = custUnit + self.builtInUnit = builtInUnit + self.dispUnitsLbl = dispUnitsLbl + + +class NumericAxis(_BaseAxis): + + tagname = "valAx" + + axId = _BaseAxis.axId + scaling = _BaseAxis.scaling + delete = _BaseAxis.delete + axPos = _BaseAxis.axPos + majorGridlines = _BaseAxis.majorGridlines + minorGridlines = _BaseAxis.minorGridlines + title = _BaseAxis.title + numFmt = _BaseAxis.numFmt + majorTickMark = _BaseAxis.majorTickMark + minorTickMark = _BaseAxis.minorTickMark + tickLblPos = _BaseAxis.tickLblPos + spPr = _BaseAxis.spPr + txPr = _BaseAxis.txPr + crossAx = _BaseAxis.crossAx + crosses = _BaseAxis.crosses + crossesAt = _BaseAxis.crossesAt + + crossBetween = NestedNoneSet(values=(['between', 'midCat'])) + majorUnit = NestedFloat(allow_none=True) + minorUnit = NestedFloat(allow_none=True) + dispUnits = Typed(expected_type=DisplayUnitsLabelList, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = _BaseAxis.__elements__ + ('crossBetween', 'majorUnit', + 'minorUnit', 'dispUnits',) + + + def __init__(self, + crossBetween=None, + majorUnit=None, + minorUnit=None, + dispUnits=None, + extLst=None, + **kw + ): + self.crossBetween = crossBetween + self.majorUnit = majorUnit + self.minorUnit = minorUnit + self.dispUnits = dispUnits + kw.setdefault('majorGridlines', ChartLines()) + kw.setdefault('axId', 100) + kw.setdefault('crossAx', 10) + super().__init__(**kw) + + + @classmethod + def from_tree(cls, node): + """ + Special case value axes with no gridlines + """ + self = super().from_tree(node) + gridlines = node.find("{%s}majorGridlines" % CHART_NS) + if gridlines is None: + self.majorGridlines = None + return self + + + +class TextAxis(_BaseAxis): + + tagname = "catAx" + + axId = _BaseAxis.axId + scaling = _BaseAxis.scaling + delete = _BaseAxis.delete + axPos = _BaseAxis.axPos + majorGridlines = _BaseAxis.majorGridlines + minorGridlines = _BaseAxis.minorGridlines + title = _BaseAxis.title + numFmt = _BaseAxis.numFmt + majorTickMark = _BaseAxis.majorTickMark + minorTickMark = _BaseAxis.minorTickMark + tickLblPos = _BaseAxis.tickLblPos + spPr = _BaseAxis.spPr + txPr = _BaseAxis.txPr + crossAx = _BaseAxis.crossAx + crosses = _BaseAxis.crosses + crossesAt = _BaseAxis.crossesAt + + auto = NestedBool(allow_none=True) + lblAlgn = NestedNoneSet(values=(['ctr', 'l', 'r'])) + lblOffset = NestedMinMax(min=0, max=1000) + tickLblSkip = NestedInteger(allow_none=True) + tickMarkSkip = NestedInteger(allow_none=True) + noMultiLvlLbl = NestedBool(allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = _BaseAxis.__elements__ + ('auto', 'lblAlgn', 'lblOffset', + 'tickLblSkip', 'tickMarkSkip', 'noMultiLvlLbl') + + def __init__(self, + auto=None, + lblAlgn=None, + lblOffset=100, + tickLblSkip=None, + tickMarkSkip=None, + noMultiLvlLbl=None, + extLst=None, + **kw + ): + self.auto = auto + self.lblAlgn = lblAlgn + self.lblOffset = lblOffset + self.tickLblSkip = tickLblSkip + self.tickMarkSkip = tickMarkSkip + self.noMultiLvlLbl = noMultiLvlLbl + kw.setdefault('axId', 10) + kw.setdefault('crossAx', 100) + super().__init__(**kw) + + +class DateAxis(TextAxis): + + tagname = "dateAx" + + axId = _BaseAxis.axId + scaling = _BaseAxis.scaling + delete = _BaseAxis.delete + axPos = _BaseAxis.axPos + majorGridlines = _BaseAxis.majorGridlines + minorGridlines = _BaseAxis.minorGridlines + title = _BaseAxis.title + numFmt = _BaseAxis.numFmt + majorTickMark = _BaseAxis.majorTickMark + minorTickMark = _BaseAxis.minorTickMark + tickLblPos = _BaseAxis.tickLblPos + spPr = _BaseAxis.spPr + txPr = _BaseAxis.txPr + crossAx = _BaseAxis.crossAx + crosses = _BaseAxis.crosses + crossesAt = _BaseAxis.crossesAt + + auto = NestedBool(allow_none=True) + lblOffset = NestedInteger(allow_none=True) + baseTimeUnit = NestedNoneSet(values=(['days', 'months', 'years'])) + majorUnit = NestedFloat(allow_none=True) + majorTimeUnit = NestedNoneSet(values=(['days', 'months', 'years'])) + minorUnit = NestedFloat(allow_none=True) + minorTimeUnit = NestedNoneSet(values=(['days', 'months', 'years'])) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = _BaseAxis.__elements__ + ('auto', 'lblOffset', + 'baseTimeUnit', 'majorUnit', 'majorTimeUnit', 'minorUnit', + 'minorTimeUnit') + + def __init__(self, + auto=None, + lblOffset=None, + baseTimeUnit=None, + majorUnit=None, + majorTimeUnit=None, + minorUnit=None, + minorTimeUnit=None, + extLst=None, + **kw + ): + self.auto = auto + self.lblOffset = lblOffset + self.baseTimeUnit = baseTimeUnit + self.majorUnit = majorUnit + self.majorTimeUnit = majorTimeUnit + self.minorUnit = minorUnit + self.minorTimeUnit = minorTimeUnit + kw.setdefault('axId', 500) + kw.setdefault('lblOffset', lblOffset) + super().__init__(**kw) + + +class SeriesAxis(_BaseAxis): + + tagname = "serAx" + + axId = _BaseAxis.axId + scaling = _BaseAxis.scaling + delete = _BaseAxis.delete + axPos = _BaseAxis.axPos + majorGridlines = _BaseAxis.majorGridlines + minorGridlines = _BaseAxis.minorGridlines + title = _BaseAxis.title + numFmt = _BaseAxis.numFmt + majorTickMark = _BaseAxis.majorTickMark + minorTickMark = _BaseAxis.minorTickMark + tickLblPos = _BaseAxis.tickLblPos + spPr = _BaseAxis.spPr + txPr = _BaseAxis.txPr + crossAx = _BaseAxis.crossAx + crosses = _BaseAxis.crosses + crossesAt = _BaseAxis.crossesAt + + tickLblSkip = NestedInteger(allow_none=True) + tickMarkSkip = NestedInteger(allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = _BaseAxis.__elements__ + ('tickLblSkip', 'tickMarkSkip') + + def __init__(self, + tickLblSkip=None, + tickMarkSkip=None, + extLst=None, + **kw + ): + self.tickLblSkip = tickLblSkip + self.tickMarkSkip = tickMarkSkip + kw.setdefault('axId', 1000) + kw.setdefault('crossAx', 10) + super().__init__(**kw) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/bar_chart.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/bar_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..fa08e07645181e69f94660e1361b7c895541a5a8 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/bar_chart.py @@ -0,0 +1,144 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Bool, + Integer, + Sequence, + Alias, +) +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedNoneSet, + NestedSet, + NestedBool, + NestedInteger, + NestedMinMax, +) + +from .descriptors import ( + NestedGapAmount, + NestedOverlap, +) +from ._chart import ChartBase +from ._3d import _3DBase +from .axis import TextAxis, NumericAxis, SeriesAxis, ChartLines +from .shapes import GraphicalProperties +from .series import Series +from .legend import Legend +from .label import DataLabelList + + +class _BarChartBase(ChartBase): + + barDir = NestedSet(values=(['bar', 'col'])) + type = Alias("barDir") + grouping = NestedSet(values=(['percentStacked', 'clustered', 'standard', + 'stacked'])) + varyColors = NestedBool(nested=True, allow_none=True) + ser = Sequence(expected_type=Series, allow_none=True) + dLbls = Typed(expected_type=DataLabelList, allow_none=True) + dataLabels = Alias("dLbls") + + __elements__ = ('barDir', 'grouping', 'varyColors', 'ser', 'dLbls') + + _series_type = "bar" + + def __init__(self, + barDir="col", + grouping="clustered", + varyColors=None, + ser=(), + dLbls=None, + **kw + ): + self.barDir = barDir + self.grouping = grouping + self.varyColors = varyColors + self.ser = ser + self.dLbls = dLbls + super().__init__(**kw) + + +class BarChart(_BarChartBase): + + tagname = "barChart" + + barDir = _BarChartBase.barDir + grouping = _BarChartBase.grouping + varyColors = _BarChartBase.varyColors + ser = _BarChartBase.ser + dLbls = _BarChartBase.dLbls + + gapWidth = NestedGapAmount() + overlap = NestedOverlap() + serLines = Typed(expected_type=ChartLines, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + # chart properties actually used by containing classes + x_axis = Typed(expected_type=TextAxis) + y_axis = Typed(expected_type=NumericAxis) + + __elements__ = _BarChartBase.__elements__ + ('gapWidth', 'overlap', 'serLines', 'axId') + + def __init__(self, + gapWidth=150, + overlap=None, + serLines=None, + extLst=None, + **kw + ): + self.gapWidth = gapWidth + self.overlap = overlap + self.serLines = serLines + self.x_axis = TextAxis() + self.y_axis = NumericAxis() + self.legend = Legend() + super().__init__(**kw) + + +class BarChart3D(_BarChartBase, _3DBase): + + tagname = "bar3DChart" + + barDir = _BarChartBase.barDir + grouping = _BarChartBase.grouping + varyColors = _BarChartBase.varyColors + ser = _BarChartBase.ser + dLbls = _BarChartBase.dLbls + + view3D = _3DBase.view3D + floor = _3DBase.floor + sideWall = _3DBase.sideWall + backWall = _3DBase.backWall + + gapWidth = NestedGapAmount() + gapDepth = NestedGapAmount() + shape = NestedNoneSet(values=(['cone', 'coneToMax', 'box', 'cylinder', 'pyramid', 'pyramidToMax'])) + serLines = Typed(expected_type=ChartLines, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + x_axis = Typed(expected_type=TextAxis) + y_axis = Typed(expected_type=NumericAxis) + z_axis = Typed(expected_type=SeriesAxis, allow_none=True) + + __elements__ = _BarChartBase.__elements__ + ('gapWidth', 'gapDepth', 'shape', 'serLines', 'axId') + + def __init__(self, + gapWidth=150, + gapDepth=150, + shape=None, + serLines=None, + extLst=None, + **kw + ): + self.gapWidth = gapWidth + self.gapDepth = gapDepth + self.shape = shape + self.serLines = serLines + self.x_axis = TextAxis() + self.y_axis = NumericAxis() + self.z_axis = SeriesAxis() + + super(BarChart3D, self).__init__(**kw) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/bubble_chart.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/bubble_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..3fca043ab78fee9b1f5518cb12fc000d05549fd2 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/bubble_chart.py @@ -0,0 +1,67 @@ +#Autogenerated schema +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Set, + MinMax, + Bool, + Integer, + Alias, + Sequence, +) +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedNoneSet, + NestedMinMax, + NestedBool, +) + +from ._chart import ChartBase +from .axis import TextAxis, NumericAxis +from .series import XYSeries +from .label import DataLabelList + + +class BubbleChart(ChartBase): + + tagname = "bubbleChart" + + varyColors = NestedBool(allow_none=True) + ser = Sequence(expected_type=XYSeries, allow_none=True) + dLbls = Typed(expected_type=DataLabelList, allow_none=True) + dataLabels = Alias("dLbls") + bubble3D = NestedBool(allow_none=True) + bubbleScale = NestedMinMax(min=0, max=300, allow_none=True) + showNegBubbles = NestedBool(allow_none=True) + sizeRepresents = NestedNoneSet(values=(['area', 'w'])) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + x_axis = Typed(expected_type=NumericAxis) + y_axis = Typed(expected_type=NumericAxis) + + _series_type = "bubble" + + __elements__ = ('varyColors', 'ser', 'dLbls', 'bubble3D', 'bubbleScale', + 'showNegBubbles', 'sizeRepresents', 'axId') + + def __init__(self, + varyColors=None, + ser=(), + dLbls=None, + bubble3D=None, + bubbleScale=None, + showNegBubbles=None, + sizeRepresents=None, + extLst=None, + **kw + ): + self.varyColors = varyColors + self.ser = ser + self.dLbls = dLbls + self.bubble3D = bubble3D + self.bubbleScale = bubbleScale + self.showNegBubbles = showNegBubbles + self.sizeRepresents = sizeRepresents + self.x_axis = NumericAxis(axId=10, crossAx=20) + self.y_axis = NumericAxis(axId=20, crossAx=10) + super().__init__(**kw) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/chartspace.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/chartspace.py new file mode 100644 index 0000000000000000000000000000000000000000..cba213c240e13b1274e8dea2cac8288d44ad74ac --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/chartspace.py @@ -0,0 +1,195 @@ + +# Copyright (c) 2010-2024 openpyxl + +""" +Enclosing chart object. The various chart types are actually child objects. +Will probably need to call this indirectly +""" + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + String, + Alias, +) +from openpyxl.descriptors.excel import ( + ExtensionList, + Relation +) +from openpyxl.descriptors.nested import ( + NestedBool, + NestedNoneSet, + NestedString, + NestedMinMax, +) +from openpyxl.descriptors.sequence import NestedSequence +from openpyxl.xml.constants import CHART_NS + +from openpyxl.drawing.colors import ColorMapping +from .text import RichText +from .shapes import GraphicalProperties +from .legend import Legend +from ._3d import _3DBase +from .plotarea import PlotArea +from .title import Title +from .pivot import ( + PivotFormat, + PivotSource, +) +from .print_settings import PrintSettings + + +class ChartContainer(Serialisable): + + tagname = "chart" + + title = Typed(expected_type=Title, allow_none=True) + autoTitleDeleted = NestedBool(allow_none=True) + pivotFmts = NestedSequence(expected_type=PivotFormat) + view3D = _3DBase.view3D + floor = _3DBase.floor + sideWall = _3DBase.sideWall + backWall = _3DBase.backWall + plotArea = Typed(expected_type=PlotArea, ) + legend = Typed(expected_type=Legend, allow_none=True) + plotVisOnly = NestedBool() + dispBlanksAs = NestedNoneSet(values=(['span', 'gap', 'zero'])) + showDLblsOverMax = NestedBool(allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('title', 'autoTitleDeleted', 'pivotFmts', 'view3D', + 'floor', 'sideWall', 'backWall', 'plotArea', 'legend', 'plotVisOnly', + 'dispBlanksAs', 'showDLblsOverMax') + + def __init__(self, + title=None, + autoTitleDeleted=None, + pivotFmts=(), + view3D=None, + floor=None, + sideWall=None, + backWall=None, + plotArea=None, + legend=None, + plotVisOnly=True, + dispBlanksAs="gap", + showDLblsOverMax=None, + extLst=None, + ): + self.title = title + self.autoTitleDeleted = autoTitleDeleted + self.pivotFmts = pivotFmts + self.view3D = view3D + self.floor = floor + self.sideWall = sideWall + self.backWall = backWall + if plotArea is None: + plotArea = PlotArea() + self.plotArea = plotArea + self.legend = legend + self.plotVisOnly = plotVisOnly + self.dispBlanksAs = dispBlanksAs + self.showDLblsOverMax = showDLblsOverMax + + +class Protection(Serialisable): + + tagname = "protection" + + chartObject = NestedBool(allow_none=True) + data = NestedBool(allow_none=True) + formatting = NestedBool(allow_none=True) + selection = NestedBool(allow_none=True) + userInterface = NestedBool(allow_none=True) + + __elements__ = ("chartObject", "data", "formatting", "selection", "userInterface") + + def __init__(self, + chartObject=None, + data=None, + formatting=None, + selection=None, + userInterface=None, + ): + self.chartObject = chartObject + self.data = data + self.formatting = formatting + self.selection = selection + self.userInterface = userInterface + + +class ExternalData(Serialisable): + + tagname = "externalData" + + autoUpdate = NestedBool(allow_none=True) + id = String() # Needs namespace + + def __init__(self, + autoUpdate=None, + id=None + ): + self.autoUpdate = autoUpdate + self.id = id + + +class ChartSpace(Serialisable): + + tagname = "chartSpace" + + date1904 = NestedBool(allow_none=True) + lang = NestedString(allow_none=True) + roundedCorners = NestedBool(allow_none=True) + style = NestedMinMax(allow_none=True, min=1, max=48) + clrMapOvr = Typed(expected_type=ColorMapping, allow_none=True) + pivotSource = Typed(expected_type=PivotSource, allow_none=True) + protection = Typed(expected_type=Protection, allow_none=True) + chart = Typed(expected_type=ChartContainer) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphical_properties = Alias("spPr") + txPr = Typed(expected_type=RichText, allow_none=True) + textProperties = Alias("txPr") + externalData = Typed(expected_type=ExternalData, allow_none=True) + printSettings = Typed(expected_type=PrintSettings, allow_none=True) + userShapes = Relation() + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('date1904', 'lang', 'roundedCorners', 'style', + 'clrMapOvr', 'pivotSource', 'protection', 'chart', 'spPr', 'txPr', + 'externalData', 'printSettings', 'userShapes') + + def __init__(self, + date1904=None, + lang=None, + roundedCorners=None, + style=None, + clrMapOvr=None, + pivotSource=None, + protection=None, + chart=None, + spPr=None, + txPr=None, + externalData=None, + printSettings=None, + userShapes=None, + extLst=None, + ): + self.date1904 = date1904 + self.lang = lang + self.roundedCorners = roundedCorners + self.style = style + self.clrMapOvr = clrMapOvr + self.pivotSource = pivotSource + self.protection = protection + self.chart = chart + self.spPr = spPr + self.txPr = txPr + self.externalData = externalData + self.printSettings = printSettings + self.userShapes = userShapes + + + def to_tree(self, tagname=None, idx=None, namespace=None): + tree = super().to_tree() + tree.set("xmlns", CHART_NS) + return tree diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/data_source.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/data_source.py new file mode 100644 index 0000000000000000000000000000000000000000..c38eafb2fe6079d8c827e7464cefe3063c800ff2 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/data_source.py @@ -0,0 +1,246 @@ +""" +Collection of utility primitives for charts. +""" + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Bool, + Typed, + Alias, + String, + Integer, + Sequence, +) +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedString, + NestedText, + NestedInteger, +) + + +class NumFmt(Serialisable): + + formatCode = String() + sourceLinked = Bool() + + def __init__(self, + formatCode=None, + sourceLinked=False + ): + self.formatCode = formatCode + self.sourceLinked = sourceLinked + + +class NumberValueDescriptor(NestedText): + """ + Data should be numerical but isn't always :-/ + """ + + allow_none = True + + def __set__(self, instance, value): + if value == "#N/A": + self.expected_type = str + else: + self.expected_type = float + super().__set__(instance, value) + + +class NumVal(Serialisable): + + idx = Integer() + formatCode = NestedText(allow_none=True, expected_type=str) + v = NumberValueDescriptor() + + def __init__(self, + idx=None, + formatCode=None, + v=None, + ): + self.idx = idx + self.formatCode = formatCode + self.v = v + + +class NumData(Serialisable): + + formatCode = NestedText(expected_type=str, allow_none=True) + ptCount = NestedInteger(allow_none=True) + pt = Sequence(expected_type=NumVal) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('formatCode', 'ptCount', 'pt') + + def __init__(self, + formatCode=None, + ptCount=None, + pt=(), + extLst=None, + ): + self.formatCode = formatCode + self.ptCount = ptCount + self.pt = pt + + +class NumRef(Serialisable): + + f = NestedText(expected_type=str) + ref = Alias('f') + numCache = Typed(expected_type=NumData, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('f', 'numCache') + + def __init__(self, + f=None, + numCache=None, + extLst=None, + ): + self.f = f + self.numCache = numCache + + +class StrVal(Serialisable): + + tagname = "strVal" + + idx = Integer() + v = NestedText(expected_type=str) + + def __init__(self, + idx=0, + v=None, + ): + self.idx = idx + self.v = v + + +class StrData(Serialisable): + + tagname = "strData" + + ptCount = NestedInteger(allow_none=True) + pt = Sequence(expected_type=StrVal) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('ptCount', 'pt') + + def __init__(self, + ptCount=None, + pt=(), + extLst=None, + ): + self.ptCount = ptCount + self.pt = pt + + +class StrRef(Serialisable): + + tagname = "strRef" + + f = NestedText(expected_type=str, allow_none=True) + strCache = Typed(expected_type=StrData, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('f', 'strCache') + + def __init__(self, + f=None, + strCache=None, + extLst=None, + ): + self.f = f + self.strCache = strCache + + +class NumDataSource(Serialisable): + + numRef = Typed(expected_type=NumRef, allow_none=True) + numLit = Typed(expected_type=NumData, allow_none=True) + + + def __init__(self, + numRef=None, + numLit=None, + ): + self.numRef = numRef + self.numLit = numLit + + +class Level(Serialisable): + + tagname = "lvl" + + pt = Sequence(expected_type=StrVal) + + __elements__ = ('pt',) + + def __init__(self, + pt=(), + ): + self.pt = pt + + +class MultiLevelStrData(Serialisable): + + tagname = "multiLvlStrData" + + ptCount = Integer(allow_none=True) + lvl = Sequence(expected_type=Level) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('ptCount', 'lvl',) + + def __init__(self, + ptCount=None, + lvl=(), + extLst=None, + ): + self.ptCount = ptCount + self.lvl = lvl + + +class MultiLevelStrRef(Serialisable): + + tagname = "multiLvlStrRef" + + f = NestedText(expected_type=str) + multiLvlStrCache = Typed(expected_type=MultiLevelStrData, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('multiLvlStrCache', 'f') + + def __init__(self, + f=None, + multiLvlStrCache=None, + extLst=None, + ): + self.f = f + self.multiLvlStrCache = multiLvlStrCache + + +class AxDataSource(Serialisable): + + tagname = "cat" + + numRef = Typed(expected_type=NumRef, allow_none=True) + numLit = Typed(expected_type=NumData, allow_none=True) + strRef = Typed(expected_type=StrRef, allow_none=True) + strLit = Typed(expected_type=StrData, allow_none=True) + multiLvlStrRef = Typed(expected_type=MultiLevelStrRef, allow_none=True) + + def __init__(self, + numRef=None, + numLit=None, + strRef=None, + strLit=None, + multiLvlStrRef=None, + ): + if not any([numLit, numRef, strRef, strLit, multiLvlStrRef]): + raise TypeError("A data source must be provided") + self.numRef = numRef + self.numLit = numLit + self.strRef = strRef + self.strLit = strLit + self.multiLvlStrRef = multiLvlStrRef diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/descriptors.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/descriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..6bc9434893673d743482617507b2f6efc9630ff8 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/descriptors.py @@ -0,0 +1,43 @@ +# Copyright (c) 2010-2024 openpyxl + + + +from openpyxl.descriptors.nested import ( + NestedMinMax + ) + +from openpyxl.descriptors import Typed + +from .data_source import NumFmt + +""" +Utility descriptors for the chart module. +For convenience but also clarity. +""" + +class NestedGapAmount(NestedMinMax): + + allow_none = True + min = 0 + max = 500 + + +class NestedOverlap(NestedMinMax): + + allow_none = True + min = -100 + max = 100 + + +class NumberFormatDescriptor(Typed): + """ + Allow direct assignment of format code + """ + + expected_type = NumFmt + allow_none = True + + def __set__(self, instance, value): + if isinstance(value, str): + value = NumFmt(value) + super().__set__(instance, value) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/error_bar.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/error_bar.py new file mode 100644 index 0000000000000000000000000000000000000000..6ae24451eb7d4320fe10a68237cba85b3a5d207b --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/error_bar.py @@ -0,0 +1,62 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Float, + Set, + Alias +) + +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedNoneSet, + NestedSet, + NestedBool, + NestedFloat, +) + +from .data_source import NumDataSource +from .shapes import GraphicalProperties + + +class ErrorBars(Serialisable): + + tagname = "errBars" + + errDir = NestedNoneSet(values=(['x', 'y'])) + direction = Alias("errDir") + errBarType = NestedSet(values=(['both', 'minus', 'plus'])) + style = Alias("errBarType") + errValType = NestedSet(values=(['cust', 'fixedVal', 'percentage', 'stdDev', 'stdErr'])) + size = Alias("errValType") + noEndCap = NestedBool(nested=True, allow_none=True) + plus = Typed(expected_type=NumDataSource, allow_none=True) + minus = Typed(expected_type=NumDataSource, allow_none=True) + val = NestedFloat(allow_none=True) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias("spPr") + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('errDir','errBarType', 'errValType', 'noEndCap','minus', 'plus', 'val', 'spPr') + + + def __init__(self, + errDir=None, + errBarType="both", + errValType="fixedVal", + noEndCap=None, + plus=None, + minus=None, + val=None, + spPr=None, + extLst=None, + ): + self.errDir = errDir + self.errBarType = errBarType + self.errValType = errValType + self.noEndCap = noEndCap + self.plus = plus + self.minus = minus + self.val = val + self.spPr = spPr diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/label.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/label.py new file mode 100644 index 0000000000000000000000000000000000000000..d6eacb16a1290d74cc2980f808abc0b3818d1609 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/label.py @@ -0,0 +1,127 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Sequence, + Alias, + Typed +) +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedNoneSet, + NestedBool, + NestedString, + NestedInteger, + ) + +from .shapes import GraphicalProperties +from .text import RichText + + +class _DataLabelBase(Serialisable): + + numFmt = NestedString(allow_none=True, attribute="formatCode") + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias('spPr') + txPr = Typed(expected_type=RichText, allow_none=True) + textProperties = Alias('txPr') + dLblPos = NestedNoneSet(values=['bestFit', 'b', 'ctr', 'inBase', 'inEnd', + 'l', 'outEnd', 'r', 't']) + position = Alias('dLblPos') + showLegendKey = NestedBool(allow_none=True) + showVal = NestedBool(allow_none=True) + showCatName = NestedBool(allow_none=True) + showSerName = NestedBool(allow_none=True) + showPercent = NestedBool(allow_none=True) + showBubbleSize = NestedBool(allow_none=True) + showLeaderLines = NestedBool(allow_none=True) + separator = NestedString(allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ("numFmt", "spPr", "txPr", "dLblPos", "showLegendKey", + "showVal", "showCatName", "showSerName", "showPercent", "showBubbleSize", + "showLeaderLines", "separator") + + def __init__(self, + numFmt=None, + spPr=None, + txPr=None, + dLblPos=None, + showLegendKey=None, + showVal=None, + showCatName=None, + showSerName=None, + showPercent=None, + showBubbleSize=None, + showLeaderLines=None, + separator=None, + extLst=None, + ): + self.numFmt = numFmt + self.spPr = spPr + self.txPr = txPr + self.dLblPos = dLblPos + self.showLegendKey = showLegendKey + self.showVal = showVal + self.showCatName = showCatName + self.showSerName = showSerName + self.showPercent = showPercent + self.showBubbleSize = showBubbleSize + self.showLeaderLines = showLeaderLines + self.separator = separator + + +class DataLabel(_DataLabelBase): + + tagname = "dLbl" + + idx = NestedInteger() + + numFmt = _DataLabelBase.numFmt + spPr = _DataLabelBase.spPr + txPr = _DataLabelBase.txPr + dLblPos = _DataLabelBase.dLblPos + showLegendKey = _DataLabelBase.showLegendKey + showVal = _DataLabelBase.showVal + showCatName = _DataLabelBase.showCatName + showSerName = _DataLabelBase.showSerName + showPercent = _DataLabelBase.showPercent + showBubbleSize = _DataLabelBase.showBubbleSize + showLeaderLines = _DataLabelBase.showLeaderLines + separator = _DataLabelBase.separator + extLst = _DataLabelBase.extLst + + __elements__ = ("idx",) + _DataLabelBase.__elements__ + + def __init__(self, idx=0, **kw ): + self.idx = idx + super().__init__(**kw) + + +class DataLabelList(_DataLabelBase): + + tagname = "dLbls" + + dLbl = Sequence(expected_type=DataLabel, allow_none=True) + + delete = NestedBool(allow_none=True) + numFmt = _DataLabelBase.numFmt + spPr = _DataLabelBase.spPr + txPr = _DataLabelBase.txPr + dLblPos = _DataLabelBase.dLblPos + showLegendKey = _DataLabelBase.showLegendKey + showVal = _DataLabelBase.showVal + showCatName = _DataLabelBase.showCatName + showSerName = _DataLabelBase.showSerName + showPercent = _DataLabelBase.showPercent + showBubbleSize = _DataLabelBase.showBubbleSize + showLeaderLines = _DataLabelBase.showLeaderLines + separator = _DataLabelBase.separator + extLst = _DataLabelBase.extLst + + __elements__ = ("delete", "dLbl",) + _DataLabelBase.__elements__ + + def __init__(self, dLbl=(), delete=None, **kw): + self.dLbl = dLbl + self.delete = delete + super().__init__(**kw) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/layout.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/layout.py new file mode 100644 index 0000000000000000000000000000000000000000..f2f655300a4fad2cfe8c9814d7329a0882951202 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/layout.py @@ -0,0 +1,74 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + NoneSet, + Float, + Typed, + Alias, +) + +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedNoneSet, + NestedSet, + NestedMinMax, +) + +class ManualLayout(Serialisable): + + tagname = "manualLayout" + + layoutTarget = NestedNoneSet(values=(['inner', 'outer'])) + xMode = NestedNoneSet(values=(['edge', 'factor'])) + yMode = NestedNoneSet(values=(['edge', 'factor'])) + wMode = NestedSet(values=(['edge', 'factor'])) + hMode = NestedSet(values=(['edge', 'factor'])) + x = NestedMinMax(min=-1, max=1, allow_none=True) + y = NestedMinMax(min=-1, max=1, allow_none=True) + w = NestedMinMax(min=0, max=1, allow_none=True) + width = Alias('w') + h = NestedMinMax(min=0, max=1, allow_none=True) + height = Alias('h') + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('layoutTarget', 'xMode', 'yMode', 'wMode', 'hMode', 'x', + 'y', 'w', 'h') + + def __init__(self, + layoutTarget=None, + xMode=None, + yMode=None, + wMode="factor", + hMode="factor", + x=None, + y=None, + w=None, + h=None, + extLst=None, + ): + self.layoutTarget = layoutTarget + self.xMode = xMode + self.yMode = yMode + self.wMode = wMode + self.hMode = hMode + self.x = x + self.y = y + self.w = w + self.h = h + + +class Layout(Serialisable): + + tagname = "layout" + + manualLayout = Typed(expected_type=ManualLayout, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('manualLayout',) + + def __init__(self, + manualLayout=None, + extLst=None, + ): + self.manualLayout = manualLayout diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/legend.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/legend.py new file mode 100644 index 0000000000000000000000000000000000000000..1f7c802ba7d880ae4980d2a8cca8acc184864dfe --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/legend.py @@ -0,0 +1,75 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Integer, + Alias, + Sequence, +) +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedBool, + NestedSet, + NestedInteger +) + +from .layout import Layout +from .shapes import GraphicalProperties +from .text import RichText + + +class LegendEntry(Serialisable): + + tagname = "legendEntry" + + idx = NestedInteger() + delete = NestedBool() + txPr = Typed(expected_type=RichText, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('idx', 'delete', 'txPr') + + def __init__(self, + idx=0, + delete=False, + txPr=None, + extLst=None, + ): + self.idx = idx + self.delete = delete + self.txPr = txPr + + +class Legend(Serialisable): + + tagname = "legend" + + legendPos = NestedSet(values=(['b', 'tr', 'l', 'r', 't'])) + position = Alias('legendPos') + legendEntry = Sequence(expected_type=LegendEntry) + layout = Typed(expected_type=Layout, allow_none=True) + overlay = NestedBool(allow_none=True) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias('spPr') + txPr = Typed(expected_type=RichText, allow_none=True) + textProperties = Alias('txPr') + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('legendPos', 'legendEntry', 'layout', 'overlay', 'spPr', 'txPr',) + + def __init__(self, + legendPos="r", + legendEntry=(), + layout=None, + overlay=None, + spPr=None, + txPr=None, + extLst=None, + ): + self.legendPos = legendPos + self.legendEntry = legendEntry + self.layout = layout + self.overlay = overlay + self.spPr = spPr + self.txPr = txPr diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/line_chart.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/line_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..0aa3ad5b2cb0f7c2a9b0a95fcd48b88ff1830976 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/line_chart.py @@ -0,0 +1,129 @@ +#Autogenerated schema +from openpyxl.descriptors import ( + Typed, + Sequence, + Alias, + ) +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedSet, + NestedBool, +) + +from ._chart import ChartBase +from .updown_bars import UpDownBars +from .descriptors import NestedGapAmount +from .axis import TextAxis, NumericAxis, SeriesAxis, ChartLines, _BaseAxis +from .label import DataLabelList +from .series import Series + + +class _LineChartBase(ChartBase): + + grouping = NestedSet(values=(['percentStacked', 'standard', 'stacked'])) + varyColors = NestedBool(allow_none=True) + ser = Sequence(expected_type=Series, allow_none=True) + dLbls = Typed(expected_type=DataLabelList, allow_none=True) + dataLabels = Alias("dLbls") + dropLines = Typed(expected_type=ChartLines, allow_none=True) + + _series_type = "line" + + __elements__ = ('grouping', 'varyColors', 'ser', 'dLbls', 'dropLines') + + def __init__(self, + grouping="standard", + varyColors=None, + ser=(), + dLbls=None, + dropLines=None, + **kw + ): + self.grouping = grouping + self.varyColors = varyColors + self.ser = ser + self.dLbls = dLbls + self.dropLines = dropLines + super().__init__(**kw) + + +class LineChart(_LineChartBase): + + tagname = "lineChart" + + grouping = _LineChartBase.grouping + varyColors = _LineChartBase.varyColors + ser = _LineChartBase.ser + dLbls = _LineChartBase.dLbls + dropLines =_LineChartBase.dropLines + + hiLowLines = Typed(expected_type=ChartLines, allow_none=True) + upDownBars = Typed(expected_type=UpDownBars, allow_none=True) + marker = NestedBool(allow_none=True) + smooth = NestedBool(allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + x_axis = Typed(expected_type=_BaseAxis) + y_axis = Typed(expected_type=NumericAxis) + + __elements__ = _LineChartBase.__elements__ + ('hiLowLines', 'upDownBars', 'marker', 'smooth', 'axId') + + def __init__(self, + hiLowLines=None, + upDownBars=None, + marker=None, + smooth=None, + extLst=None, + **kw + ): + self.hiLowLines = hiLowLines + self.upDownBars = upDownBars + self.marker = marker + self.smooth = smooth + self.x_axis = TextAxis() + self.y_axis = NumericAxis() + + super().__init__(**kw) + + +class LineChart3D(_LineChartBase): + + tagname = "line3DChart" + + grouping = _LineChartBase.grouping + varyColors = _LineChartBase.varyColors + ser = _LineChartBase.ser + dLbls = _LineChartBase.dLbls + dropLines =_LineChartBase.dropLines + + gapDepth = NestedGapAmount() + hiLowLines = Typed(expected_type=ChartLines, allow_none=True) + upDownBars = Typed(expected_type=UpDownBars, allow_none=True) + marker = NestedBool(allow_none=True) + smooth = NestedBool(allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + x_axis = Typed(expected_type=TextAxis) + y_axis = Typed(expected_type=NumericAxis) + z_axis = Typed(expected_type=SeriesAxis) + + __elements__ = _LineChartBase.__elements__ + ('gapDepth', 'hiLowLines', + 'upDownBars', 'marker', 'smooth', 'axId') + + def __init__(self, + gapDepth=None, + hiLowLines=None, + upDownBars=None, + marker=None, + smooth=None, + **kw + ): + self.gapDepth = gapDepth + self.hiLowLines = hiLowLines + self.upDownBars = upDownBars + self.marker = marker + self.smooth = smooth + self.x_axis = TextAxis() + self.y_axis = NumericAxis() + self.z_axis = SeriesAxis() + super(LineChart3D, self).__init__(**kw) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/pie_chart.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/pie_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..6bb67e1e600690455b6b130dbc62fdae7ddb31f6 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/pie_chart.py @@ -0,0 +1,177 @@ +#Autogenerated schema +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Bool, + MinMax, + Integer, + NoneSet, + Float, + Alias, + Sequence, +) +from openpyxl.descriptors.excel import ExtensionList, Percentage +from openpyxl.descriptors.nested import ( + NestedBool, + NestedMinMax, + NestedInteger, + NestedFloat, + NestedNoneSet, + NestedSet, +) +from openpyxl.descriptors.sequence import ValueSequence + +from ._chart import ChartBase +from .axis import ChartLines +from .descriptors import NestedGapAmount +from .series import Series +from .label import DataLabelList + + +class _PieChartBase(ChartBase): + + varyColors = NestedBool(allow_none=True) + ser = Sequence(expected_type=Series, allow_none=True) + dLbls = Typed(expected_type=DataLabelList, allow_none=True) + dataLabels = Alias("dLbls") + + _series_type = "pie" + + __elements__ = ('varyColors', 'ser', 'dLbls') + + def __init__(self, + varyColors=True, + ser=(), + dLbls=None, + ): + self.varyColors = varyColors + self.ser = ser + self.dLbls = dLbls + super().__init__() + + + +class PieChart(_PieChartBase): + + tagname = "pieChart" + + varyColors = _PieChartBase.varyColors + ser = _PieChartBase.ser + dLbls = _PieChartBase.dLbls + + firstSliceAng = NestedMinMax(min=0, max=360) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = _PieChartBase.__elements__ + ('firstSliceAng', ) + + def __init__(self, + firstSliceAng=0, + extLst=None, + **kw + ): + self.firstSliceAng = firstSliceAng + super().__init__(**kw) + + +class PieChart3D(_PieChartBase): + + tagname = "pie3DChart" + + varyColors = _PieChartBase.varyColors + ser = _PieChartBase.ser + dLbls = _PieChartBase.dLbls + + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = _PieChartBase.__elements__ + + +class DoughnutChart(_PieChartBase): + + tagname = "doughnutChart" + + varyColors = _PieChartBase.varyColors + ser = _PieChartBase.ser + dLbls = _PieChartBase.dLbls + + firstSliceAng = NestedMinMax(min=0, max=360) + holeSize = NestedMinMax(min=1, max=90, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = _PieChartBase.__elements__ + ('firstSliceAng', 'holeSize') + + def __init__(self, + firstSliceAng=0, + holeSize=10, + extLst=None, + **kw + ): + self.firstSliceAng = firstSliceAng + self.holeSize = holeSize + super().__init__(**kw) + + +class CustomSplit(Serialisable): + + tagname = "custSplit" + + secondPiePt = ValueSequence(expected_type=int) + + __elements__ = ('secondPiePt',) + + def __init__(self, + secondPiePt=(), + ): + self.secondPiePt = secondPiePt + + +class ProjectedPieChart(_PieChartBase): + + """ + From the spec 21.2.2.126 + + This element contains the pie of pie or bar of pie series on this + chart. Only the first series shall be displayed. The splitType element + shall determine whether the splitPos and custSplit elements apply. + """ + + tagname = "ofPieChart" + + varyColors = _PieChartBase.varyColors + ser = _PieChartBase.ser + dLbls = _PieChartBase.dLbls + + ofPieType = NestedSet(values=(['pie', 'bar'])) + type = Alias('ofPieType') + gapWidth = NestedGapAmount() + splitType = NestedNoneSet(values=(['auto', 'cust', 'percent', 'pos', 'val'])) + splitPos = NestedFloat(allow_none=True) + custSplit = Typed(expected_type=CustomSplit, allow_none=True) + secondPieSize = NestedMinMax(min=5, max=200, allow_none=True) + serLines = Typed(expected_type=ChartLines, allow_none=True) + join_lines = Alias('serLines') + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = _PieChartBase.__elements__ + ('ofPieType', 'gapWidth', + 'splitType', 'splitPos', 'custSplit', 'secondPieSize', 'serLines') + + def __init__(self, + ofPieType="pie", + gapWidth=None, + splitType="auto", + splitPos=None, + custSplit=None, + secondPieSize=75, + serLines=None, + extLst=None, + **kw + ): + self.ofPieType = ofPieType + self.gapWidth = gapWidth + self.splitType = splitType + self.splitPos = splitPos + self.custSplit = custSplit + self.secondPieSize = secondPieSize + if serLines is None: + self.serLines = ChartLines() + super().__init__(**kw) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/pivot.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/pivot.py new file mode 100644 index 0000000000000000000000000000000000000000..937fd2948b43f517bc7c99368b4a6258297fe102 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/pivot.py @@ -0,0 +1,65 @@ + +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Alias, + Typed, +) +from openpyxl.descriptors.nested import NestedInteger, NestedText +from openpyxl.descriptors.excel import ExtensionList + +from .label import DataLabel +from .marker import Marker +from .shapes import GraphicalProperties +from .text import RichText + + +class PivotSource(Serialisable): + + tagname = "pivotSource" + + name = NestedText(expected_type=str) + fmtId = NestedInteger(expected_type=int) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('name', 'fmtId') + + def __init__(self, + name=None, + fmtId=None, + extLst=None, + ): + self.name = name + self.fmtId = fmtId + + +class PivotFormat(Serialisable): + + tagname = "pivotFmt" + + idx = NestedInteger(nested=True) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias("spPr") + txPr = Typed(expected_type=RichText, allow_none=True) + TextBody = Alias("txPr") + marker = Typed(expected_type=Marker, allow_none=True) + dLbl = Typed(expected_type=DataLabel, allow_none=True) + DataLabel = Alias("dLbl") + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('idx', 'spPr', 'txPr', 'marker', 'dLbl') + + def __init__(self, + idx=0, + spPr=None, + txPr=None, + marker=None, + dLbl=None, + extLst=None, + ): + self.idx = idx + self.spPr = spPr + self.txPr = txPr + self.marker = marker + self.dLbl = dLbl diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/plotarea.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/plotarea.py new file mode 100644 index 0000000000000000000000000000000000000000..268bfbc4ce8eaa6130a5783e6de49c56a54f4c60 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/plotarea.py @@ -0,0 +1,162 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Alias, +) +from openpyxl.descriptors.excel import ( + ExtensionList, +) +from openpyxl.descriptors.sequence import ( + MultiSequence, + MultiSequencePart, +) +from openpyxl.descriptors.nested import ( + NestedBool, +) + +from ._3d import _3DBase +from .area_chart import AreaChart, AreaChart3D +from .bar_chart import BarChart, BarChart3D +from .bubble_chart import BubbleChart +from .line_chart import LineChart, LineChart3D +from .pie_chart import PieChart, PieChart3D, ProjectedPieChart, DoughnutChart +from .radar_chart import RadarChart +from .scatter_chart import ScatterChart +from .stock_chart import StockChart +from .surface_chart import SurfaceChart, SurfaceChart3D +from .layout import Layout +from .shapes import GraphicalProperties +from .text import RichText + +from .axis import ( + NumericAxis, + TextAxis, + SeriesAxis, + DateAxis, +) + + +class DataTable(Serialisable): + + tagname = "dTable" + + showHorzBorder = NestedBool(allow_none=True) + showVertBorder = NestedBool(allow_none=True) + showOutline = NestedBool(allow_none=True) + showKeys = NestedBool(allow_none=True) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias('spPr') + txPr = Typed(expected_type=RichText, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('showHorzBorder', 'showVertBorder', 'showOutline', + 'showKeys', 'spPr', 'txPr') + + def __init__(self, + showHorzBorder=None, + showVertBorder=None, + showOutline=None, + showKeys=None, + spPr=None, + txPr=None, + extLst=None, + ): + self.showHorzBorder = showHorzBorder + self.showVertBorder = showVertBorder + self.showOutline = showOutline + self.showKeys = showKeys + self.spPr = spPr + self.txPr = txPr + + +class PlotArea(Serialisable): + + tagname = "plotArea" + + layout = Typed(expected_type=Layout, allow_none=True) + dTable = Typed(expected_type=DataTable, allow_none=True) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias("spPr") + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + # at least one chart + _charts = MultiSequence() + areaChart = MultiSequencePart(expected_type=AreaChart, store="_charts") + area3DChart = MultiSequencePart(expected_type=AreaChart3D, store="_charts") + lineChart = MultiSequencePart(expected_type=LineChart, store="_charts") + line3DChart = MultiSequencePart(expected_type=LineChart3D, store="_charts") + stockChart = MultiSequencePart(expected_type=StockChart, store="_charts") + radarChart = MultiSequencePart(expected_type=RadarChart, store="_charts") + scatterChart = MultiSequencePart(expected_type=ScatterChart, store="_charts") + pieChart = MultiSequencePart(expected_type=PieChart, store="_charts") + pie3DChart = MultiSequencePart(expected_type=PieChart3D, store="_charts") + doughnutChart = MultiSequencePart(expected_type=DoughnutChart, store="_charts") + barChart = MultiSequencePart(expected_type=BarChart, store="_charts") + bar3DChart = MultiSequencePart(expected_type=BarChart3D, store="_charts") + ofPieChart = MultiSequencePart(expected_type=ProjectedPieChart, store="_charts") + surfaceChart = MultiSequencePart(expected_type=SurfaceChart, store="_charts") + surface3DChart = MultiSequencePart(expected_type=SurfaceChart3D, store="_charts") + bubbleChart = MultiSequencePart(expected_type=BubbleChart, store="_charts") + + # axes + _axes = MultiSequence() + valAx = MultiSequencePart(expected_type=NumericAxis, store="_axes") + catAx = MultiSequencePart(expected_type=TextAxis, store="_axes") + dateAx = MultiSequencePart(expected_type=DateAxis, store="_axes") + serAx = MultiSequencePart(expected_type=SeriesAxis, store="_axes") + + __elements__ = ('layout', '_charts', '_axes', 'dTable', 'spPr') + + def __init__(self, + layout=None, + dTable=None, + spPr=None, + _charts=(), + _axes=(), + extLst=None, + ): + self.layout = layout + self.dTable = dTable + self.spPr = spPr + self._charts = _charts + self._axes = _axes + + + def to_tree(self, tagname=None, idx=None, namespace=None): + axIds = {ax.axId for ax in self._axes} + for chart in self._charts: + for id, axis in chart._axes.items(): + if id not in axIds: + setattr(self, axis.tagname, axis) + axIds.add(id) + + return super().to_tree(tagname) + + + @classmethod + def from_tree(cls, node): + self = super().from_tree(node) + axes = dict((axis.axId, axis) for axis in self._axes) + for chart in self._charts: + if isinstance(chart, (ScatterChart, BubbleChart)): + x, y = (axes[axId] for axId in chart.axId) + chart.x_axis = x + chart.y_axis = y + continue + + for axId in chart.axId: + axis = axes.get(axId) + if axis is None and isinstance(chart, _3DBase): + # Series Axis can be optional + chart.z_axis = None + continue + if axis.tagname in ("catAx", "dateAx"): + chart.x_axis = axis + elif axis.tagname == "valAx": + chart.y_axis = axis + elif axis.tagname == "serAx": + chart.z_axis = axis + + return self diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/print_settings.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/print_settings.py new file mode 100644 index 0000000000000000000000000000000000000000..65137310afb4d10b045185220e79caf2efca49a3 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/print_settings.py @@ -0,0 +1,57 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Float, + Typed, + Alias, +) + +from openpyxl.worksheet.page import PrintPageSetup +from openpyxl.worksheet.header_footer import HeaderFooter + + +class PageMargins(Serialisable): + """ + Identical to openpyxl.worksheet.page.Pagemargins but element names are different :-/ + """ + tagname = "pageMargins" + + l = Float() + left = Alias('l') + r = Float() + right = Alias('r') + t = Float() + top = Alias('t') + b = Float() + bottom = Alias('b') + header = Float() + footer = Float() + + def __init__(self, l=0.75, r=0.75, t=1, b=1, header=0.5, footer=0.5): + self.l = l + self.r = r + self.t = t + self.b = b + self.header = header + self.footer = footer + + +class PrintSettings(Serialisable): + + tagname = "printSettings" + + headerFooter = Typed(expected_type=HeaderFooter, allow_none=True) + pageMargins = Typed(expected_type=PageMargins, allow_none=True) + pageSetup = Typed(expected_type=PrintPageSetup, allow_none=True) + + __elements__ = ("headerFooter", "pageMargins", "pageMargins") + + def __init__(self, + headerFooter=None, + pageMargins=None, + pageSetup=None, + ): + self.headerFooter = headerFooter + self.pageMargins = pageMargins + self.pageSetup = pageSetup diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/reader.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/reader.py new file mode 100644 index 0000000000000000000000000000000000000000..0ef719f9febb50b93bd35633f28fd87a50474ce3 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/reader.py @@ -0,0 +1,32 @@ +# Copyright (c) 2010-2024 openpyxl + +""" +Read a chart +""" + +def read_chart(chartspace): + cs = chartspace + plot = cs.chart.plotArea + + chart = plot._charts[0] + chart._charts = plot._charts + + chart.title = cs.chart.title + chart.display_blanks = cs.chart.dispBlanksAs + chart.visible_cells_only = cs.chart.plotVisOnly + chart.layout = plot.layout + chart.legend = cs.chart.legend + + # 3d attributes + chart.floor = cs.chart.floor + chart.sideWall = cs.chart.sideWall + chart.backWall = cs.chart.backWall + chart.pivotSource = cs.pivotSource + chart.pivotFormats = cs.chart.pivotFmts + chart.idx_base = min((s.idx for s in chart.series), default=0) + chart._reindex() + + # Border, fill, etc. + chart.graphical_properties = cs.graphical_properties + + return chart diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/reference.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/reference.py new file mode 100644 index 0000000000000000000000000000000000000000..dc102791cd4d3498d589165bb789ead807707f42 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/reference.py @@ -0,0 +1,124 @@ +# Copyright (c) 2010-2024 openpyxl + +from itertools import chain + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + MinMax, + Typed, + String, + Strict, +) +from openpyxl.worksheet.worksheet import Worksheet +from openpyxl.utils import ( + get_column_letter, + range_to_tuple, + quote_sheetname +) + + +class DummyWorksheet: + + + def __init__(self, title): + self.title = title + + +class Reference(Strict): + + """ + Normalise cell range references + """ + + min_row = MinMax(min=1, max=1000000, expected_type=int) + max_row = MinMax(min=1, max=1000000, expected_type=int) + min_col = MinMax(min=1, max=16384, expected_type=int) + max_col = MinMax(min=1, max=16384, expected_type=int) + range_string = String(allow_none=True) + + def __init__(self, + worksheet=None, + min_col=None, + min_row=None, + max_col=None, + max_row=None, + range_string=None + ): + if range_string is not None: + sheetname, boundaries = range_to_tuple(range_string) + min_col, min_row, max_col, max_row = boundaries + worksheet = DummyWorksheet(sheetname) + + self.worksheet = worksheet + self.min_col = min_col + self.min_row = min_row + if max_col is None: + max_col = min_col + self.max_col = max_col + if max_row is None: + max_row = min_row + self.max_row = max_row + + + def __repr__(self): + return str(self) + + + def __str__(self): + fmt = u"{0}!${1}${2}:${3}${4}" + if (self.min_col == self.max_col + and self.min_row == self.max_row): + fmt = u"{0}!${1}${2}" + return fmt.format(self.sheetname, + get_column_letter(self.min_col), self.min_row, + get_column_letter(self.max_col), self.max_row + ) + + + __str__ = __str__ + + + + def __len__(self): + if self.min_row == self.max_row: + return 1 + self.max_col - self.min_col + return 1 + self.max_row - self.min_row + + + def __eq__(self, other): + return str(self) == str(other) + + + @property + def rows(self): + """ + Return all rows in the range + """ + for row in range(self.min_row, self.max_row+1): + yield Reference(self.worksheet, self.min_col, row, self.max_col, row) + + + @property + def cols(self): + """ + Return all columns in the range + """ + for col in range(self.min_col, self.max_col+1): + yield Reference(self.worksheet, col, self.min_row, col, self.max_row) + + + def pop(self): + """ + Return and remove the first cell + """ + cell = "{0}{1}".format(get_column_letter(self.min_col), self.min_row) + if self.min_row == self.max_row: + self.min_col += 1 + else: + self.min_row += 1 + return cell + + + @property + def sheetname(self): + return quote_sheetname(self.worksheet.title) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/scatter_chart.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/scatter_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..2699239e0a53479be3cbdf2afac5abf68ad38178 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/scatter_chart.py @@ -0,0 +1,53 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Sequence, + Alias +) +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedNoneSet, + NestedBool, +) + +from ._chart import ChartBase +from .axis import NumericAxis, TextAxis +from .series import XYSeries +from .label import DataLabelList + + +class ScatterChart(ChartBase): + + tagname = "scatterChart" + + scatterStyle = NestedNoneSet(values=(['line', 'lineMarker', 'marker', 'smooth', 'smoothMarker'])) + varyColors = NestedBool(allow_none=True) + ser = Sequence(expected_type=XYSeries, allow_none=True) + dLbls = Typed(expected_type=DataLabelList, allow_none=True) + dataLabels = Alias("dLbls") + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + x_axis = Typed(expected_type=(NumericAxis, TextAxis)) + y_axis = Typed(expected_type=NumericAxis) + + _series_type = "scatter" + + __elements__ = ('scatterStyle', 'varyColors', 'ser', 'dLbls', 'axId',) + + def __init__(self, + scatterStyle=None, + varyColors=None, + ser=(), + dLbls=None, + extLst=None, + **kw + ): + self.scatterStyle = scatterStyle + self.varyColors = varyColors + self.ser = ser + self.dLbls = dLbls + self.x_axis = NumericAxis(axId=10, crossAx=20) + self.y_axis = NumericAxis(axId=20, crossAx=10) + super().__init__(**kw) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/shapes.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/shapes.py new file mode 100644 index 0000000000000000000000000000000000000000..7736c1adfbb3a3df797110c1882c355e5c5cac70 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/shapes.py @@ -0,0 +1,89 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Alias +) +from openpyxl.descriptors.nested import ( + EmptyTag +) +from openpyxl.drawing.colors import ColorChoiceDescriptor +from openpyxl.drawing.fill import * +from openpyxl.drawing.line import LineProperties +from openpyxl.drawing.geometry import ( + Shape3D, + Scene3D, + Transform2D, + CustomGeometry2D, + PresetGeometry2D, +) + + +class GraphicalProperties(Serialisable): + + """ + Somewhat vaguely 21.2.2.197 says this: + + This element specifies the formatting for the parent chart element. The + custGeom, prstGeom, scene3d, and xfrm elements are not supported. The + bwMode attribute is not supported. + + This doesn't leave much. And the element is used in different places. + """ + + tagname = "spPr" + + bwMode = NoneSet(values=(['clr', 'auto', 'gray', 'ltGray', 'invGray', + 'grayWhite', 'blackGray', 'blackWhite', 'black', 'white', 'hidden'] + ) + ) + + xfrm = Typed(expected_type=Transform2D, allow_none=True) + transform = Alias('xfrm') + custGeom = Typed(expected_type=CustomGeometry2D, allow_none=True) # either or + prstGeom = Typed(expected_type=PresetGeometry2D, allow_none=True) + + # fills one of + noFill = EmptyTag(namespace=DRAWING_NS) + solidFill = ColorChoiceDescriptor() + gradFill = Typed(expected_type=GradientFillProperties, allow_none=True) + pattFill = Typed(expected_type=PatternFillProperties, allow_none=True) + + ln = Typed(expected_type=LineProperties, allow_none=True) + line = Alias('ln') + scene3d = Typed(expected_type=Scene3D, allow_none=True) + sp3d = Typed(expected_type=Shape3D, allow_none=True) + shape3D = Alias('sp3d') + extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True) + + __elements__ = ('xfrm', 'prstGeom', 'noFill', 'solidFill', 'gradFill', 'pattFill', + 'ln', 'scene3d', 'sp3d') + + def __init__(self, + bwMode=None, + xfrm=None, + noFill=None, + solidFill=None, + gradFill=None, + pattFill=None, + ln=None, + scene3d=None, + custGeom=None, + prstGeom=None, + sp3d=None, + extLst=None, + ): + self.bwMode = bwMode + self.xfrm = xfrm + self.noFill = noFill + self.solidFill = solidFill + self.gradFill = gradFill + self.pattFill = pattFill + if ln is None: + ln = LineProperties() + self.ln = ln + self.custGeom = custGeom + self.prstGeom = prstGeom + self.scene3d = scene3d + self.sp3d = sp3d diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/stock_chart.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/stock_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..119c790165675025fe5f090d46e0466f4e76ed5f --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/stock_chart.py @@ -0,0 +1,54 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Sequence, + Alias, +) +from openpyxl.descriptors.excel import ExtensionList + +from ._chart import ChartBase +from .axis import TextAxis, NumericAxis, ChartLines +from .updown_bars import UpDownBars +from .label import DataLabelList +from .series import Series + + +class StockChart(ChartBase): + + tagname = "stockChart" + + ser = Sequence(expected_type=Series) #min 3, max4 + dLbls = Typed(expected_type=DataLabelList, allow_none=True) + dataLabels = Alias('dLbls') + dropLines = Typed(expected_type=ChartLines, allow_none=True) + hiLowLines = Typed(expected_type=ChartLines, allow_none=True) + upDownBars = Typed(expected_type=UpDownBars, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + x_axis = Typed(expected_type=TextAxis) + y_axis = Typed(expected_type=NumericAxis) + + _series_type = "line" + + __elements__ = ('ser', 'dLbls', 'dropLines', 'hiLowLines', 'upDownBars', + 'axId') + + def __init__(self, + ser=(), + dLbls=None, + dropLines=None, + hiLowLines=None, + upDownBars=None, + extLst=None, + **kw + ): + self.ser = ser + self.dLbls = dLbls + self.dropLines = dropLines + self.hiLowLines = hiLowLines + self.upDownBars = upDownBars + self.x_axis = TextAxis() + self.y_axis = NumericAxis() + super().__init__(**kw) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/surface_chart.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/surface_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..5f388e146ad896f6b47e7ae22020f4e7c21476f8 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/surface_chart.py @@ -0,0 +1,119 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Integer, + Bool, + Alias, + Sequence, +) +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedInteger, + NestedBool, +) + +from ._chart import ChartBase +from ._3d import _3DBase +from .axis import TextAxis, NumericAxis, SeriesAxis +from .shapes import GraphicalProperties +from .series import Series + + +class BandFormat(Serialisable): + + tagname = "bandFmt" + + idx = NestedInteger() + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias("spPr") + + __elements__ = ('idx', 'spPr') + + def __init__(self, + idx=0, + spPr=None, + ): + self.idx = idx + self.spPr = spPr + + +class BandFormatList(Serialisable): + + tagname = "bandFmts" + + bandFmt = Sequence(expected_type=BandFormat, allow_none=True) + + __elements__ = ('bandFmt',) + + def __init__(self, + bandFmt=(), + ): + self.bandFmt = bandFmt + + +class _SurfaceChartBase(ChartBase): + + wireframe = NestedBool(allow_none=True) + ser = Sequence(expected_type=Series, allow_none=True) + bandFmts = Typed(expected_type=BandFormatList, allow_none=True) + + _series_type = "surface" + + __elements__ = ('wireframe', 'ser', 'bandFmts') + + def __init__(self, + wireframe=None, + ser=(), + bandFmts=None, + **kw + ): + self.wireframe = wireframe + self.ser = ser + self.bandFmts = bandFmts + super().__init__(**kw) + + +class SurfaceChart3D(_SurfaceChartBase, _3DBase): + + tagname = "surface3DChart" + + wireframe = _SurfaceChartBase.wireframe + ser = _SurfaceChartBase.ser + bandFmts = _SurfaceChartBase.bandFmts + + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + x_axis = Typed(expected_type=TextAxis) + y_axis = Typed(expected_type=NumericAxis) + z_axis = Typed(expected_type=SeriesAxis) + + __elements__ = _SurfaceChartBase.__elements__ + ('axId',) + + def __init__(self, **kw): + self.x_axis = TextAxis() + self.y_axis = NumericAxis() + self.z_axis = SeriesAxis() + super(SurfaceChart3D, self).__init__(**kw) + + +class SurfaceChart(SurfaceChart3D): + + tagname = "surfaceChart" + + wireframe = _SurfaceChartBase.wireframe + ser = _SurfaceChartBase.ser + bandFmts = _SurfaceChartBase.bandFmts + + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = SurfaceChart3D.__elements__ + + def __init__(self, **kw): + super().__init__(**kw) + self.y_axis.delete = True + self.view3D.x_rotation = 90 + self.view3D.y_rotation = 0 + self.view3D.perspective = False + self.view3D.right_angle_axes = False diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/text.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/text.py new file mode 100644 index 0000000000000000000000000000000000000000..bd034c242ff3c30855dc9c62082aa95d197fb4ea --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/text.py @@ -0,0 +1,78 @@ +# Copyright (c) 2010-2024 openpyxl +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Alias, + Sequence, +) + + +from openpyxl.drawing.text import ( + RichTextProperties, + ListStyle, + Paragraph, +) + +from .data_source import StrRef + + +class RichText(Serialisable): + + """ + From the specification: 21.2.2.216 + + This element specifies text formatting. The lstStyle element is not supported. + """ + + tagname = "rich" + + bodyPr = Typed(expected_type=RichTextProperties) + properties = Alias("bodyPr") + lstStyle = Typed(expected_type=ListStyle, allow_none=True) + p = Sequence(expected_type=Paragraph) + paragraphs = Alias('p') + + __elements__ = ("bodyPr", "lstStyle", "p") + + def __init__(self, + bodyPr=None, + lstStyle=None, + p=None, + ): + if bodyPr is None: + bodyPr = RichTextProperties() + self.bodyPr = bodyPr + self.lstStyle = lstStyle + if p is None: + p = [Paragraph()] + self.p = p + + +class Text(Serialisable): + + """ + The value can be either a cell reference or a text element + If both are present then the reference will be used. + """ + + tagname = "tx" + + strRef = Typed(expected_type=StrRef, allow_none=True) + rich = Typed(expected_type=RichText, allow_none=True) + + __elements__ = ("strRef", "rich") + + def __init__(self, + strRef=None, + rich=None + ): + self.strRef = strRef + if rich is None: + rich = RichText() + self.rich = rich + + + def to_tree(self, tagname=None, idx=None, namespace=None): + if self.strRef and self.rich: + self.rich = None # can only have one + return super().to_tree(tagname, idx, namespace) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/title.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/title.py new file mode 100644 index 0000000000000000000000000000000000000000..10f79d7ad3b3068a4c3f16d8b8b197d7f5cee880 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/title.py @@ -0,0 +1,76 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + Alias, +) + +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool + +from .text import Text, RichText +from .layout import Layout +from .shapes import GraphicalProperties + +from openpyxl.drawing.text import ( + Paragraph, + RegularTextRun, + LineBreak, + ParagraphProperties, + CharacterProperties, +) + + +class Title(Serialisable): + tagname = "title" + + tx = Typed(expected_type=Text, allow_none=True) + text = Alias('tx') + layout = Typed(expected_type=Layout, allow_none=True) + overlay = NestedBool(allow_none=True) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias('spPr') + txPr = Typed(expected_type=RichText, allow_none=True) + body = Alias('txPr') + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('tx', 'layout', 'overlay', 'spPr', 'txPr') + + def __init__(self, + tx=None, + layout=None, + overlay=None, + spPr=None, + txPr=None, + extLst=None, + ): + if tx is None: + tx = Text() + self.tx = tx + self.layout = layout + self.overlay = overlay + self.spPr = spPr + self.txPr = txPr + + + +def title_maker(text): + title = Title() + paraprops = ParagraphProperties() + paraprops.defRPr = CharacterProperties() + paras = [Paragraph(r=[RegularTextRun(t=s)], pPr=paraprops) for s in text.split("\n")] + + title.tx.rich.paragraphs = paras + return title + + +class TitleDescriptor(Typed): + + expected_type = Title + allow_none = True + + def __set__(self, instance, value): + if isinstance(value, str): + value = title_maker(value) + super().__set__(instance, value) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/trendline.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/trendline.py new file mode 100644 index 0000000000000000000000000000000000000000..bf6d2366e1c4620eb72f286f80d9f6b3710da6a7 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/trendline.py @@ -0,0 +1,98 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + String, + Alias +) +from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedBool, + NestedInteger, + NestedFloat, + NestedSet +) + +from .data_source import NumFmt +from .shapes import GraphicalProperties +from .text import RichText, Text +from .layout import Layout + + +class TrendlineLabel(Serialisable): + + tagname = "trendlineLbl" + + layout = Typed(expected_type=Layout, allow_none=True) + tx = Typed(expected_type=Text, allow_none=True) + numFmt = Typed(expected_type=NumFmt, allow_none=True) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias("spPr") + txPr = Typed(expected_type=RichText, allow_none=True) + textProperties = Alias("txPr") + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('layout', 'tx', 'numFmt', 'spPr', 'txPr') + + def __init__(self, + layout=None, + tx=None, + numFmt=None, + spPr=None, + txPr=None, + extLst=None, + ): + self.layout = layout + self.tx = tx + self.numFmt = numFmt + self.spPr = spPr + self.txPr = txPr + + +class Trendline(Serialisable): + + tagname = "trendline" + + name = String(allow_none=True) + spPr = Typed(expected_type=GraphicalProperties, allow_none=True) + graphicalProperties = Alias('spPr') + trendlineType = NestedSet(values=(['exp', 'linear', 'log', 'movingAvg', 'poly', 'power'])) + order = NestedInteger(allow_none=True) + period = NestedInteger(allow_none=True) + forward = NestedFloat(allow_none=True) + backward = NestedFloat(allow_none=True) + intercept = NestedFloat(allow_none=True) + dispRSqr = NestedBool(allow_none=True) + dispEq = NestedBool(allow_none=True) + trendlineLbl = Typed(expected_type=TrendlineLabel, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('spPr', 'trendlineType', 'order', 'period', 'forward', + 'backward', 'intercept', 'dispRSqr', 'dispEq', 'trendlineLbl') + + def __init__(self, + name=None, + spPr=None, + trendlineType='linear', + order=None, + period=None, + forward=None, + backward=None, + intercept=None, + dispRSqr=None, + dispEq=None, + trendlineLbl=None, + extLst=None, + ): + self.name = name + self.spPr = spPr + self.trendlineType = trendlineType + self.order = order + self.period = period + self.forward = forward + self.backward = backward + self.intercept = intercept + self.dispRSqr = dispRSqr + self.dispEq = dispEq + self.trendlineLbl = trendlineLbl diff --git a/vllm/lib/python3.10/site-packages/openpyxl/chart/updown_bars.py b/vllm/lib/python3.10/site-packages/openpyxl/chart/updown_bars.py new file mode 100644 index 0000000000000000000000000000000000000000..6de7ab8a72870395c6416979809bad619610fc26 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/chart/updown_bars.py @@ -0,0 +1,31 @@ +# Copyright (c) 2010-2024 openpyxl + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import Typed +from openpyxl.descriptors.excel import ExtensionList + +from .shapes import GraphicalProperties +from .axis import ChartLines +from .descriptors import NestedGapAmount + + +class UpDownBars(Serialisable): + + tagname = "upbars" + + gapWidth = NestedGapAmount() + upBars = Typed(expected_type=ChartLines, allow_none=True) + downBars = Typed(expected_type=ChartLines, allow_none=True) + extLst = Typed(expected_type=ExtensionList, allow_none=True) + + __elements__ = ('gapWidth', 'upBars', 'downBars') + + def __init__(self, + gapWidth=150, + upBars=None, + downBars=None, + extLst=None, + ): + self.gapWidth = gapWidth + self.upBars = upBars + self.downBars = downBars diff --git a/vllm/lib/python3.10/site-packages/openpyxl/formatting/__pycache__/__init__.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/formatting/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e8ff4b95f9cd9f4962ab04e16b38764992632b6c Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/formatting/__pycache__/__init__.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/formatting/__pycache__/formatting.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/formatting/__pycache__/formatting.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9592f0ce9d62a22afa582ccfd19b1ab27c7235ed Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/formatting/__pycache__/formatting.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/formatting/formatting.py b/vllm/lib/python3.10/site-packages/openpyxl/formatting/formatting.py new file mode 100644 index 0000000000000000000000000000000000000000..bf622bf998c69b3ce4414a0d557b0975ec7ea0a6 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/formatting/formatting.py @@ -0,0 +1,114 @@ +# Copyright (c) 2010-2024 openpyxl + +from collections import OrderedDict + +from openpyxl.descriptors import ( + Bool, + Sequence, + Alias, + Convertible, +) +from openpyxl.descriptors.serialisable import Serialisable + +from .rule import Rule + +from openpyxl.worksheet.cell_range import MultiCellRange + +class ConditionalFormatting(Serialisable): + + tagname = "conditionalFormatting" + + sqref = Convertible(expected_type=MultiCellRange) + cells = Alias("sqref") + pivot = Bool(allow_none=True) + cfRule = Sequence(expected_type=Rule) + rules = Alias("cfRule") + + + def __init__(self, sqref=(), pivot=None, cfRule=(), extLst=None): + self.sqref = sqref + self.pivot = pivot + self.cfRule = cfRule + + + def __eq__(self, other): + if not isinstance(other, self.__class__): + return False + return self.sqref == other.sqref + + + def __hash__(self): + return hash(self.sqref) + + + def __repr__(self): + return "<{cls} {cells}>".format(cls=self.__class__.__name__, cells=self.sqref) + + + def __contains__(self, coord): + """ + Check whether a certain cell is affected by the formatting + """ + return coord in self.sqref + + +class ConditionalFormattingList: + """Conditional formatting rules.""" + + + def __init__(self): + self._cf_rules = OrderedDict() + self.max_priority = 0 + + + def add(self, range_string, cfRule): + """Add a rule such as ColorScaleRule, FormulaRule or CellIsRule + + The priority will be added automatically. + """ + cf = range_string + if isinstance(range_string, str): + cf = ConditionalFormatting(range_string) + if not isinstance(cfRule, Rule): + raise ValueError("Only instances of openpyxl.formatting.rule.Rule may be added") + rule = cfRule + self.max_priority += 1 + if not rule.priority: + rule.priority = self.max_priority + + self._cf_rules.setdefault(cf, []).append(rule) + + + def __bool__(self): + return bool(self._cf_rules) + + + def __len__(self): + return len(self._cf_rules) + + + def __iter__(self): + for cf, rules in self._cf_rules.items(): + cf.rules = rules + yield cf + + + def __getitem__(self, key): + """ + Get the rules for a cell range + """ + if isinstance(key, str): + key = ConditionalFormatting(sqref=key) + return self._cf_rules[key] + + + def __delitem__(self, key): + key = ConditionalFormatting(sqref=key) + del self._cf_rules[key] + + + def __setitem__(self, key, rule): + """ + Add a rule for a cell range + """ + self.add(key, rule) diff --git a/vllm/lib/python3.10/site-packages/openpyxl/formula/__pycache__/tokenizer.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/formula/__pycache__/tokenizer.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2491476b0d5743311862c7c9a6f4bb4bb7aa51d Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/formula/__pycache__/tokenizer.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__init__.py b/vllm/lib/python3.10/site-packages/openpyxl/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f6132636caebe63abd14361c1b379921eaff4e19 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/utils/__init__.py @@ -0,0 +1,17 @@ +# Copyright (c) 2010-2024 openpyxl + + +from .cell import ( + absolute_coordinate, + cols_from_range, + column_index_from_string, + coordinate_to_tuple, + get_column_letter, + get_column_interval, + quote_sheetname, + range_boundaries, + range_to_tuple, + rows_from_range, +) + +from .formulas import FORMULAE diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/__init__.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a95c9e571fbbc96896b06bb73fdeb569113baeff Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/__init__.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/bound_dictionary.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/bound_dictionary.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d27e1764c204bf443a83527caec1837c7f5e2b98 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/bound_dictionary.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/cell.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/cell.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b813caa625cbccdf0650d7a86cacd2cd1bbf3f2 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/cell.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/dataframe.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/dataframe.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a63f4c57a4371553ee3b6b67481c9e5d17a55e00 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/dataframe.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/datetime.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/datetime.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..402e57799f3e6a20cd886fe2ba733fb7d6569b6c Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/datetime.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/exceptions.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/exceptions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..373ea89adebd32816a9681a08da39ebac44d18ed Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/exceptions.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/formulas.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/formulas.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f15c7818d62c5b675c9cf24a47a9f09f49411bb Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/formulas.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/indexed_list.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/indexed_list.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f22bb61315cc4c6f66c52662577d47b1bf314663 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/indexed_list.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/inference.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/inference.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..935b9a1b689cd3f038a6d1cb0f34287889f199b7 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/inference.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/protection.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/protection.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1015f25d84484e499672866fdd9fd80c22fc07fa Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/protection.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/units.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/units.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95c83fd393c228a5063232218bc74b8faede44ea Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/utils/__pycache__/units.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/exceptions.py b/vllm/lib/python3.10/site-packages/openpyxl/utils/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..7b05f7427bba271917116b6401c6cf60a6593077 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/utils/exceptions.py @@ -0,0 +1,34 @@ +# Copyright (c) 2010-2024 openpyxl + + +"""Definitions for openpyxl shared exception classes.""" + + +class CellCoordinatesException(Exception): + """Error for converting between numeric and A1-style cell references.""" + + +class IllegalCharacterError(Exception): + """The data submitted which cannot be used directly in Excel files. It + must be removed or escaped.""" + + +class NamedRangeException(Exception): + """Error for badly formatted named ranges.""" + + +class SheetTitleException(Exception): + """Error for bad sheet names.""" + + +class InvalidFileException(Exception): + """Error for trying to open a non-ooxml file.""" + + +class ReadOnlyWorkbookException(Exception): + """Error for trying to modify a read-only workbook""" + + +class WorkbookAlreadySaved(Exception): + """Error when attempting to perform operations on a dump workbook + while it has already been dumped once""" diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/protection.py b/vllm/lib/python3.10/site-packages/openpyxl/utils/protection.py new file mode 100644 index 0000000000000000000000000000000000000000..cc7707ee71b201d78820a4c2b27b79a034b6d230 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/utils/protection.py @@ -0,0 +1,22 @@ +# Copyright (c) 2010-2024 openpyxl + + +def hash_password(plaintext_password=''): + """ + Create a password hash from a given string for protecting a worksheet + only. This will not work for encrypting a workbook. + + This method is based on the algorithm provided by + Daniel Rentz of OpenOffice and the PEAR package + Spreadsheet_Excel_Writer by Xavier Noguer . + See also http://blogs.msdn.com/b/ericwhite/archive/2008/02/23/the-legacy-hashing-algorithm-in-open-xml.aspx + """ + password = 0x0000 + for idx, char in enumerate(plaintext_password, 1): + value = ord(char) << idx + rotated_bits = value >> 15 + value &= 0x7fff + password ^= (value | rotated_bits) + password ^= len(plaintext_password) + password ^= 0xCE4B + return str(hex(password)).upper()[2:] diff --git a/vllm/lib/python3.10/site-packages/openpyxl/utils/units.py b/vllm/lib/python3.10/site-packages/openpyxl/utils/units.py new file mode 100644 index 0000000000000000000000000000000000000000..19f23c5b53281929af7e7a1426e45a6db27a3876 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/utils/units.py @@ -0,0 +1,108 @@ + +# Copyright (c) 2010-2024 openpyxl + +import math + + +#constants + +DEFAULT_ROW_HEIGHT = 15. # Default row height measured in point size. +BASE_COL_WIDTH = 8 # in characters +DEFAULT_COLUMN_WIDTH = BASE_COL_WIDTH + 5 +# = baseColumnWidth + {margin padding (2 pixels on each side, totalling 4 pixels)} + {gridline (1pixel)} + + +DEFAULT_LEFT_MARGIN = 0.7 # in inches, = right margin +DEFAULT_TOP_MARGIN = 0.7874 # in inches = bottom margin +DEFAULT_HEADER = 0.3 # in inches + + +# Conversion functions +""" +From the ECMA Spec (4th Edition part 1) +Page setup: "Left Page Margin in inches" p. 1647 + +Docs from +http://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/ + +See also http://msdn.microsoft.com/en-us/library/dd560821(v=office.12).aspx + +dxa: The main unit in OOXML is a twentieth of a point. Also called twips. +pt: point. In Excel there are 72 points to an inch +hp: half-points are used to specify font sizes. A font-size of 12pt equals 24 half points +pct: Half-points are used to specify font sizes. A font-size of 12pt equals 24 half points + +EMU: English Metric Unit, EMUs are used for coordinates in vector-based +drawings and embedded pictures. One inch equates to 914400 EMUs and a +centimeter is 360000. For bitmaps the default resolution is 96 dpi (known as +PixelsPerInch in Excel). Spec p. 1122 + +For radial geometry Excel uses integer units of 1/60000th of a degree. +""" + + + +def inch_to_dxa(value): + """1 inch = 72 * 20 dxa""" + return int(value * 20 * 72) + +def dxa_to_inch(value): + return value / 72 / 20 + + +def dxa_to_cm(value): + return 2.54 * dxa_to_inch(value) + +def cm_to_dxa(value): + emu = cm_to_EMU(value) + inch = EMU_to_inch(emu) + return inch_to_dxa(inch) + + +def pixels_to_EMU(value): + """1 pixel = 9525 EMUs""" + return int(value * 9525) + +def EMU_to_pixels(value): + return round(value / 9525) + + +def cm_to_EMU(value): + """1 cm = 360000 EMUs""" + return int(value * 360000) + +def EMU_to_cm(value): + return round(value / 360000, 4) + + +def inch_to_EMU(value): + """1 inch = 914400 EMUs""" + return int(value * 914400) + +def EMU_to_inch(value): + return round(value / 914400, 4) + + +def pixels_to_points(value, dpi=96): + """96 dpi, 72i""" + return value * 72 / dpi + + +def points_to_pixels(value, dpi=96): + return int(math.ceil(value * dpi / 72)) + + +def degrees_to_angle(value): + """1 degree = 60000 angles""" + return int(round(value * 60000)) + + +def angle_to_degrees(value): + return round(value / 60000, 2) + + +def short_color(color): + """ format a color to its short size """ + if len(color) > 6: + return color[2:] + return color diff --git a/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/_writer.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/_writer.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..decb6f145792d09b90d392525cfbe7b4101667aa Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/_writer.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/defined_name.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/defined_name.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7da21e5a4d6487a52dac8f0eaecbd114cd1b199b Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/defined_name.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/external_reference.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/external_reference.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..677d9305adc3082ddaf57cd3f1095e36884dedbe Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/external_reference.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/properties.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/properties.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ebad86a038ad712301929169f2c6bde334f796d Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/properties.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/protection.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/protection.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..caa4f5cd46400baa9bac29ebfbf03ca2815f35df Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/protection.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/views.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9fec1e9f54f10ad2a69ff743638556b59cf6f0ca Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/views.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/workbook.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/workbook.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d79ed6774690611cb65e192c55ee222dc143d53e Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/workbook/__pycache__/workbook.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/workbook/external_link/external.py b/vllm/lib/python3.10/site-packages/openpyxl/workbook/external_link/external.py new file mode 100644 index 0000000000000000000000000000000000000000..7e2e5b20785198222580d04308ae9a0d219862e3 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/workbook/external_link/external.py @@ -0,0 +1,190 @@ +# Copyright (c) 2010-2024 openpyxl + + +from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.descriptors import ( + Typed, + String, + Bool, + Integer, + NoneSet, + Sequence, +) +from openpyxl.descriptors.excel import Relation +from openpyxl.descriptors.nested import NestedText +from openpyxl.descriptors.sequence import NestedSequence, ValueSequence + +from openpyxl.packaging.relationship import ( + Relationship, + get_rels_path, + get_dependents + ) +from openpyxl.xml.constants import SHEET_MAIN_NS +from openpyxl.xml.functions import fromstring + + +"""Manage links to external Workbooks""" + + +class ExternalCell(Serialisable): + + r = String() + t = NoneSet(values=(['b', 'd', 'n', 'e', 's', 'str', 'inlineStr'])) + vm = Integer(allow_none=True) + v = NestedText(allow_none=True, expected_type=str) + + def __init__(self, + r=None, + t=None, + vm=None, + v=None, + ): + self.r = r + self.t = t + self.vm = vm + self.v = v + + +class ExternalRow(Serialisable): + + r = Integer() + cell = Sequence(expected_type=ExternalCell) + + __elements__ = ('cell',) + + def __init__(self, + r=(), + cell=None, + ): + self.r = r + self.cell = cell + + +class ExternalSheetData(Serialisable): + + sheetId = Integer() + refreshError = Bool(allow_none=True) + row = Sequence(expected_type=ExternalRow) + + __elements__ = ('row',) + + def __init__(self, + sheetId=None, + refreshError=None, + row=(), + ): + self.sheetId = sheetId + self.refreshError = refreshError + self.row = row + + +class ExternalSheetDataSet(Serialisable): + + sheetData = Sequence(expected_type=ExternalSheetData, ) + + __elements__ = ('sheetData',) + + def __init__(self, + sheetData=None, + ): + self.sheetData = sheetData + + +class ExternalSheetNames(Serialisable): + + sheetName = ValueSequence(expected_type=str) + + __elements__ = ('sheetName',) + + def __init__(self, + sheetName=(), + ): + self.sheetName = sheetName + + +class ExternalDefinedName(Serialisable): + + tagname = "definedName" + + name = String() + refersTo = String(allow_none=True) + sheetId = Integer(allow_none=True) + + def __init__(self, + name=None, + refersTo=None, + sheetId=None, + ): + self.name = name + self.refersTo = refersTo + self.sheetId = sheetId + + +class ExternalBook(Serialisable): + + tagname = "externalBook" + + sheetNames = Typed(expected_type=ExternalSheetNames, allow_none=True) + definedNames = NestedSequence(expected_type=ExternalDefinedName) + sheetDataSet = Typed(expected_type=ExternalSheetDataSet, allow_none=True) + id = Relation() + + __elements__ = ('sheetNames', 'definedNames', 'sheetDataSet') + + def __init__(self, + sheetNames=None, + definedNames=(), + sheetDataSet=None, + id=None, + ): + self.sheetNames = sheetNames + self.definedNames = definedNames + self.sheetDataSet = sheetDataSet + self.id = id + + +class ExternalLink(Serialisable): + + tagname = "externalLink" + + _id = None + _path = "/xl/externalLinks/externalLink{0}.xml" + _rel_type = "externalLink" + mime_type = "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml" + + externalBook = Typed(expected_type=ExternalBook, allow_none=True) + file_link = Typed(expected_type=Relationship, allow_none=True) # link to external file + + __elements__ = ('externalBook', ) + + def __init__(self, + externalBook=None, + ddeLink=None, + oleLink=None, + extLst=None, + ): + self.externalBook = externalBook + # ignore other items for the moment. + + + def to_tree(self): + node = super().to_tree() + node.set("xmlns", SHEET_MAIN_NS) + return node + + + @property + def path(self): + return self._path.format(self._id) + + +def read_external_link(archive, book_path): + src = archive.read(book_path) + node = fromstring(src) + book = ExternalLink.from_tree(node) + + link_path = get_rels_path(book_path) + deps = get_dependents(archive, link_path) + book.file_link = deps[0] + + return book diff --git a/vllm/lib/python3.10/site-packages/openpyxl/writer/__init__.py b/vllm/lib/python3.10/site-packages/openpyxl/writer/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ab6cdead0e533e8069819d96d8dcb984069fce14 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/writer/__init__.py @@ -0,0 +1 @@ +# Copyright (c) 2010-2024 openpyxl diff --git a/vllm/lib/python3.10/site-packages/openpyxl/writer/__pycache__/__init__.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/writer/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2cc566aa3cf084daeed10f16bd8b2f1c8c0b563 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/writer/__pycache__/__init__.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/writer/__pycache__/excel.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/writer/__pycache__/excel.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a17e5b328347ff30db6e89bf9c0834ce5075e933 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/writer/__pycache__/excel.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/writer/__pycache__/theme.cpython-310.pyc b/vllm/lib/python3.10/site-packages/openpyxl/writer/__pycache__/theme.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40ca1cfb40a0dd2f707311d2b6cb13eef370645f Binary files /dev/null and b/vllm/lib/python3.10/site-packages/openpyxl/writer/__pycache__/theme.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/openpyxl/writer/excel.py b/vllm/lib/python3.10/site-packages/openpyxl/writer/excel.py new file mode 100644 index 0000000000000000000000000000000000000000..c1154fd296966ca862a8fcf38f44234c50ab1f67 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/writer/excel.py @@ -0,0 +1,295 @@ +# Copyright (c) 2010-2024 openpyxl + + +# Python stdlib imports +import datetime +import re +from zipfile import ZipFile, ZIP_DEFLATED + +# package imports +from openpyxl.utils.exceptions import InvalidFileException +from openpyxl.xml.constants import ( + ARC_ROOT_RELS, + ARC_WORKBOOK_RELS, + ARC_APP, + ARC_CORE, + ARC_CUSTOM, + CPROPS_TYPE, + ARC_THEME, + ARC_STYLE, + ARC_WORKBOOK, + ) +from openpyxl.drawing.spreadsheet_drawing import SpreadsheetDrawing +from openpyxl.xml.functions import tostring, fromstring +from openpyxl.packaging.manifest import Manifest +from openpyxl.packaging.relationship import ( + get_rels_path, + RelationshipList, + Relationship, +) +from openpyxl.comments.comment_sheet import CommentSheet +from openpyxl.styles.stylesheet import write_stylesheet +from openpyxl.worksheet._writer import WorksheetWriter +from openpyxl.workbook._writer import WorkbookWriter +from .theme import theme_xml + + +class ExcelWriter: + """Write a workbook object to an Excel file.""" + + def __init__(self, workbook, archive): + self._archive = archive + self.workbook = workbook + self.manifest = Manifest() + self.vba_modified = set() + self._tables = [] + self._charts = [] + self._images = [] + self._drawings = [] + self._comments = [] + self._pivots = [] + + + def write_data(self): + from openpyxl.packaging.extended import ExtendedProperties + """Write the various xml files into the zip archive.""" + # cleanup all worksheets + archive = self._archive + + props = ExtendedProperties() + archive.writestr(ARC_APP, tostring(props.to_tree())) + + archive.writestr(ARC_CORE, tostring(self.workbook.properties.to_tree())) + if self.workbook.loaded_theme: + archive.writestr(ARC_THEME, self.workbook.loaded_theme) + else: + archive.writestr(ARC_THEME, theme_xml) + + if len(self.workbook.custom_doc_props) >= 1: + archive.writestr(ARC_CUSTOM, tostring(self.workbook.custom_doc_props.to_tree())) + class CustomOverride(): + path = "/" + ARC_CUSTOM #PartName + mime_type = CPROPS_TYPE #ContentType + + custom_override = CustomOverride() + self.manifest.append(custom_override) + + self._write_worksheets() + self._write_chartsheets() + self._write_images() + self._write_charts() + + self._write_external_links() + + stylesheet = write_stylesheet(self.workbook) + archive.writestr(ARC_STYLE, tostring(stylesheet)) + + writer = WorkbookWriter(self.workbook) + archive.writestr(ARC_ROOT_RELS, writer.write_root_rels()) + archive.writestr(ARC_WORKBOOK, writer.write()) + archive.writestr(ARC_WORKBOOK_RELS, writer.write_rels()) + + self._merge_vba() + + self.manifest._write(archive, self.workbook) + + def _merge_vba(self): + """ + If workbook contains macros then extract associated files from cache + of old file and add to archive + """ + ARC_VBA = re.compile("|".join( + ('xl/vba', r'xl/drawings/.*vmlDrawing\d\.vml', + 'xl/ctrlProps', 'customUI', 'xl/activeX', r'xl/media/.*\.emf') + ) + ) + + if self.workbook.vba_archive: + for name in set(self.workbook.vba_archive.namelist()) - self.vba_modified: + if ARC_VBA.match(name): + self._archive.writestr(name, self.workbook.vba_archive.read(name)) + + + def _write_images(self): + # delegate to object + for img in self._images: + self._archive.writestr(img.path[1:], img._data()) + + + def _write_charts(self): + # delegate to object + if len(self._charts) != len(set(self._charts)): + raise InvalidFileException("The same chart cannot be used in more than one worksheet") + for chart in self._charts: + self._archive.writestr(chart.path[1:], tostring(chart._write())) + self.manifest.append(chart) + + + def _write_drawing(self, drawing): + """ + Write a drawing + """ + self._drawings.append(drawing) + drawing._id = len(self._drawings) + for chart in drawing.charts: + self._charts.append(chart) + chart._id = len(self._charts) + for img in drawing.images: + self._images.append(img) + img._id = len(self._images) + rels_path = get_rels_path(drawing.path)[1:] + self._archive.writestr(drawing.path[1:], tostring(drawing._write())) + self._archive.writestr(rels_path, tostring(drawing._write_rels())) + self.manifest.append(drawing) + + + def _write_chartsheets(self): + for idx, sheet in enumerate(self.workbook.chartsheets, 1): + + sheet._id = idx + xml = tostring(sheet.to_tree()) + + self._archive.writestr(sheet.path[1:], xml) + self.manifest.append(sheet) + + if sheet._drawing: + self._write_drawing(sheet._drawing) + + rel = Relationship(type="drawing", Target=sheet._drawing.path) + rels = RelationshipList() + rels.append(rel) + tree = rels.to_tree() + + rels_path = get_rels_path(sheet.path[1:]) + self._archive.writestr(rels_path, tostring(tree)) + + + def _write_comment(self, ws): + + cs = CommentSheet.from_comments(ws._comments) + self._comments.append(cs) + cs._id = len(self._comments) + self._archive.writestr(cs.path[1:], tostring(cs.to_tree())) + self.manifest.append(cs) + + if ws.legacy_drawing is None or self.workbook.vba_archive is None: + ws.legacy_drawing = 'xl/drawings/commentsDrawing{0}.vml'.format(cs._id) + vml = None + else: + vml = fromstring(self.workbook.vba_archive.read(ws.legacy_drawing)) + + vml = cs.write_shapes(vml) + + self._archive.writestr(ws.legacy_drawing, vml) + self.vba_modified.add(ws.legacy_drawing) + + comment_rel = Relationship(Id="comments", type=cs._rel_type, Target=cs.path) + ws._rels.append(comment_rel) + + + def write_worksheet(self, ws): + ws._drawing = SpreadsheetDrawing() + ws._drawing.charts = ws._charts + ws._drawing.images = ws._images + if self.workbook.write_only: + if not ws.closed: + ws.close() + writer = ws._writer + else: + writer = WorksheetWriter(ws) + writer.write() + + ws._rels = writer._rels + self._archive.write(writer.out, ws.path[1:]) + self.manifest.append(ws) + writer.cleanup() + + + def _write_worksheets(self): + + pivot_caches = set() + + for idx, ws in enumerate(self.workbook.worksheets, 1): + + ws._id = idx + self.write_worksheet(ws) + + if ws._drawing: + self._write_drawing(ws._drawing) + + for r in ws._rels: + if "drawing" in r.Type: + r.Target = ws._drawing.path + + if ws._comments: + self._write_comment(ws) + + if ws.legacy_drawing is not None: + shape_rel = Relationship(type="vmlDrawing", Id="anysvml", + Target="/" + ws.legacy_drawing) + ws._rels.append(shape_rel) + + for t in ws._tables.values(): + self._tables.append(t) + t.id = len(self._tables) + t._write(self._archive) + self.manifest.append(t) + ws._rels.get(t._rel_id).Target = t.path + + for p in ws._pivots: + if p.cache not in pivot_caches: + pivot_caches.add(p.cache) + p.cache._id = len(pivot_caches) + + self._pivots.append(p) + p._id = len(self._pivots) + p._write(self._archive, self.manifest) + self.workbook._pivots.append(p) + r = Relationship(Type=p.rel_type, Target=p.path) + ws._rels.append(r) + + if ws._rels: + tree = ws._rels.to_tree() + rels_path = get_rels_path(ws.path)[1:] + self._archive.writestr(rels_path, tostring(tree)) + + + def _write_external_links(self): + # delegate to object + """Write links to external workbooks""" + wb = self.workbook + for idx, link in enumerate(wb._external_links, 1): + link._id = idx + rels_path = get_rels_path(link.path[1:]) + + xml = link.to_tree() + self._archive.writestr(link.path[1:], tostring(xml)) + rels = RelationshipList() + rels.append(link.file_link) + self._archive.writestr(rels_path, tostring(rels.to_tree())) + self.manifest.append(link) + + + def save(self): + """Write data into the archive.""" + self.write_data() + self._archive.close() + + +def save_workbook(workbook, filename): + """Save the given workbook on the filesystem under the name filename. + + :param workbook: the workbook to save + :type workbook: :class:`openpyxl.workbook.Workbook` + + :param filename: the path to which save the workbook + :type filename: string + + :rtype: bool + + """ + archive = ZipFile(filename, 'w', ZIP_DEFLATED, allowZip64=True) + workbook.properties.modified = datetime.datetime.now(tz=datetime.timezone.utc).replace(tzinfo=None) + writer = ExcelWriter(workbook, archive) + writer.save() + return True diff --git a/vllm/lib/python3.10/site-packages/openpyxl/writer/theme.py b/vllm/lib/python3.10/site-packages/openpyxl/writer/theme.py new file mode 100644 index 0000000000000000000000000000000000000000..20c1d607ebd2e4b9424c825a38c44892dd430be3 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/openpyxl/writer/theme.py @@ -0,0 +1,291 @@ +# Copyright (c) 2010-2024 openpyxl + +"""Write the theme xml based on a fixed string.""" + + +theme_xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +""" + +def write_theme(): + """Write the theme xml.""" + return theme_xml