Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 682f5fc

Browse files
akharche1e-toRubtsowaPokhodenkoSAVyacheslav-Smirnov
authored
Merge master (#840)
* Df.at impl (#738) * Series.add / Series.lt with fill_value (#655) * Impl Series.skew() (#813) * Run tests in separate processes (#833) * Run tests in separate processes * Take tests list from sdc/tests/__init__.py * change README (#818) * change README * change README for doc * add refs * change ref * change ref * change ref * change readme * Improve boxing (#832) * Specify sdc version from channel for examples testing (#837) * Specify sdc version from channel for examples testing It occurs that conda resolver can take Intel SDC package not from first channel where it is found. Specify particular SDC version to avoid this in examples for now. Also print info for environment creation and package installing * Fix incerrectly used f-string * Fix log_info call * Numba 0.49.0 all (#824) * Fix run tests Remove import of _getitem_array1d * expectedFailure * expectedFailure-2 * expectedFailure-3 * Conda recipe numba==0.49 * expectedFailure-4 * Refactor imports from Numba * Unskip tests * Fix using of numpy_support.from_dtype() * Unskip tests * Fix DataFrame tests with rewrite IR without Del statements * Unskip tests * Fix corr_overload with type inference error for none < 1 * Fix hpat_pandas_series_cov with type inference error for none < 2 * Unskip tests * Unskip tests * Fixed iternext_series_array with using _getitem_array1d. _getitem_array1d is replaced with _getitem_array_single_int in Numba 0.49. * Unskip tests * Unskip old test * Fix Series.at * Unskip tests * Add decrefs in boxing (#836) * Adding extension type for pd.RangeIndex (#820) * Adding extension type for pd.RangeIndex This commit adds Numba extension types for pandas.RangeIndex class, allowing creation of pd.RangeIndex objects and passing and returning them to/from nopython functions. * Applying review comments * Fix for PR 831 (#839) * Update pyarrow version to 0.17.0 Update recipe, code and docs. * Disable intel channel * Disable intel channel for testing * Fix remarks Co-authored-by: Vyacheslav Smirnov <vyacheslav.s.smirnov@intel.com> * Update to Numba 0.49.1 (#838) * Update to Numba 0.49.1 * Fix requirements.txt * Add travis Co-authored-by: Elena Totmenina <totmeninal@mail.ru> Co-authored-by: Rubtsowa <36762665+Rubtsowa@users.noreply.github.com> Co-authored-by: Sergey Pokhodenko <sergey.pokhodenko@intel.com> Co-authored-by: Vyacheslav-Smirnov <51660067+Vyacheslav-Smirnov@users.noreply.github.com> Co-authored-by: Alexey Kozlov <52973316+kozlov-alexey@users.noreply.github.com> Co-authored-by: Vyacheslav Smirnov <vyacheslav.s.smirnov@intel.com>
1 parent efb0c64 commit 682f5fc

File tree

77 files changed

+4019
-1966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4019
-1966
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dist: trusty
44

55
branches:
66
only:
7-
- master
7+
- feature/dataframe_model_refactoring
88

99
env:
1010
global:

README.rst

Lines changed: 3 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ the code by leveraging modern hardware instructions and by utilizing all availab
2323

2424
Intel® SDC documentation can be found `here <https://intelpython.github.io/sdc-doc/>`_.
2525

26-
Intel® SDC uses special Numba build based on ``0.48.0`` tag for build and run.
27-
Required Numba version can be installed from ``intel/label/beta`` channel from the Anaconda Cloud.
28-
2926
.. note::
3027
For maximum performance and stability, please use numba from ``intel/label/beta`` channel.
3128

@@ -61,9 +58,6 @@ If you do not have conda, we recommend using Miniconda3::
6158
./miniconda.sh -b
6259
export PATH=$HOME/miniconda3/bin:$PATH
6360

64-
Intel® SDC uses special Numba build based on ``0.48.0`` tag for build and run.
65-
Required Numba version can be installed from ``intel/label/beta`` channel from the Anaconda Cloud.
66-
6761
.. note::
6862
For maximum performance and stability, please use numba from ``intel/label/beta`` channel.
6963

@@ -88,7 +82,7 @@ Building on Linux with setuptools
8882

8983
PYVER=<3.6 or 3.7>
9084
NUMPYVER=<1.16 or 1.17>
91-
conda create -n sdc-env -q -y -c intel/label/beta -c defaults -c intel -c conda-forge python=$PYVER numpy=$NUMPYVER numba=0.48.0 pandas=0.25.3 pyarrow=0.15.1 gcc_linux-64 gxx_linux-64
85+
conda create -n sdc-env -q -y -c intel/label/beta -c defaults -c intel -c conda-forge python=$PYVER numpy=$NUMPYVER numba=0.49 pandas=0.25.3 pyarrow=0.17.0 gcc_linux-64 gxx_linux-64
9286
source activate sdc-env
9387
git clone https://github.com/IntelPython/sdc.git
9488
cd sdc
@@ -126,7 +120,7 @@ Building on Windows with setuptools
126120

127121
set PYVER=<3.6 or 3.7>
128122
set NUMPYVER=<1.16 or 1.17>
129-
conda create -n sdc-env -c intel/label/beta -c defaults -c intel -c conda-forge python=%PYVER% numpy=%NUMPYVER% numba=0.48.0 pandas=0.25.3 pyarrow=0.15.1
123+
conda create -n sdc-env -c intel/label/beta -c defaults -c intel -c conda-forge python=%PYVER% numpy=%NUMPYVER% numba=0.49 pandas=0.25.3 pyarrow=0.17.0
130124
conda activate sdc-env
131125
set INCLUDE=%INCLUDE%;%CONDA_PREFIX%\Library\include
132126
set LIB=%LIB%;%CONDA_PREFIX%\Library\lib
@@ -176,146 +170,9 @@ To build HTML documentation you will need to run:
176170
The built documentation will be located in the ``./sdc/docs/build/html`` directory.
177171
To preview the documentation open ``index.html`` file.
178172

179-
`Sphinx*`_ Generation Internals
180-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181-
182-
The documentation generation is controlled by ``conf.py`` script automatically invoked by `Sphinx*`_.
183-
See `Sphinx documentation <http://www.sphinx-doc.org/en/master/usage/configuration.html>`_ for details.
184-
185-
The API Reference for Intel® SDC User's Guide is auto-generated by inspecting ``pandas`` and ``sdc`` modules.
186-
That's why these modules must be pre-installed for documentation generation using `Sphinx*`_.
187-
However, there is a possibility to skip API Reference auto-generation by setting environment variable ``SDC_DOC_NO_API_REF_STR=1``.
188-
189-
If the environment variable ``SDC_DOC_NO_API_REF_STR`` is unset then Sphinx's ``conf.py``
190-
invokes ``generate_api_reference()`` function located in ``./sdc/docs/source/buildscripts/apiref_generator`` module.
191-
This function parses ``pandas`` and ``sdc`` docstrings for each API, combines those into single docstring and
192-
writes it into RST file with respective `Pandas*`_ API name. The auto-generated RST files are
193-
located at ``./sdc/docs/source/_api_ref`` directory.
194-
195-
.. note::
196-
`Sphinx*`_ will automatically clean the ``_api_ref`` directory on the next invocation of the documenation build.
197-
198-
Intel® SDC docstring decoration rules
199-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200-
201-
Since Intel® SDC API Reference is auto-generated from respective `Pandas*`_ and Intel® SDC docstrings there are certain rules that must be
202-
followed to accurately generate the API description.
203-
204-
1. Every Intel® SDC API must have the docstring.
205-
If developer does not provide the docstring then `Sphinx*`_ will not be able to match `Pandas*`_ docstring with respective SDC one.
206-
In this situation `Sphinx*`_ assumes that SDC does not support such API and will include respective note in the API Reference that
207-
**This API is currently unsupported**.
208-
209-
2. Follow 'one function - one docstring' rule.
210-
You cannot have one docstring for multiple APIs, even if those are very similar. Auto-generator assumes every SDC API is covered by
211-
respective docstring. If `Sphinx*`_ does not find the docstring for particular API then it assumes that SDC does not support such API
212-
and will include respective note in the API Reference that **This API is currently unsupported**.
213-
214-
3. Description (introductory section, the very first few paragraphs without a title) is taken from `Pandas*`_.
215-
Intel® SDC developers should not include API description in SDC docstring.
216-
But developers are encouraged to follow Pandas API description naming conventions
217-
so that the combined docstring appears consistent.
218-
219-
4. Parameters, Returns, and Raises sections' description is taken from `Pandas*`_ docstring.
220-
Intel® SDC developers should not include such descriptions in their SDC docstrings.
221-
Rather developers are encouraged to follow Pandas naming conventions
222-
so that the combined docstring appears consistent.
223-
224-
5. Every SDC docstring must be of the follwing structure:
225-
::
226-
227-
"""
228-
Intel Scalable Dataframe Compiler User Guide
229-
********************************************
230-
Pandas API: <full pandas name, e.g. pandas.Series.nlargest>
231-
232-
<Intel® SDC specific sections>
233-
234-
Intel Scalable Dataframe Compiler Developer Guide
235-
*************************************************
236-
<Developer's Guide specific sections>
237-
"""
238-
239-
The first two lines must be the User Guide header. This is an indication to `Sphinx*`_ that this section is intended for public API
240-
and it will be combined with repsective Pandas API docstring.
241-
242-
Line 3 must specify what Pandas API this Intel® SDC docstring does correspond to. It must start with ``Pandas API:`` followed by
243-
full Pandas API name that corresponds to this SDC docstring. Remember to include full name, for example, ``nlargest`` is not
244-
sufficient for auto-generator to perform the match. The full name must be ``pandas.Series.nlargest``.
245-
246-
After User Guide sections in the docstring there can be another header indicating that the remaining part of the docstring belongs to
247-
Developer's Guide and must not be included into User's Guide.
248-
249-
6. Examples, See Also, References sections are **NOT** taken from Pandas docstring. SDC developers are expected to complete these sections in SDC doctrings.
250-
This is so because respective Pandas sections are sometimes too Pandas specific and are not relevant to SDC. SDC developers have to
251-
rewrite those sections in Intel® SDC style. Do not forget about User Guide header and Pandas API name prior to adding SDC specific
252-
sections.
253-
254-
7. Examples section is mandatory for every SDC API. 'One API - at least one example' rule is applied.
255-
Examples are essential part of user experience and must accompany every API docstring.
256-
257-
8. Embed examples into Examples section from ``./sdc/examples``.
258-
Rather than writing example in the docstring (which is error-prone) embed relevant example scripts into the docstring. For example,
259-
here is an example how to embed example for ``pandas.Series.get()`` function into respective Intel® SDC docstring:
260-
261-
::
262-
263-
"""
264-
...
265-
Examples
266-
--------
267-
.. literalinclude:: ../../../examples/series_getitem.py
268-
:language: python
269-
:lines: 27-
270-
:caption: Getting Pandas Series elements
271-
:name: ex_series_getitem
272-
273-
.. code-block:: console
274-
275-
> python ./series_getitem.py
276-
55
277-
278-
In the above snapshot the script ``series_getitem.py`` is embedded into the docstring. ``:lines: 27-`` allows to skip lengthy
279-
copyright header of the file. ``:caption:`` provides meaningful description of the example. It is a good tone to have the caption
280-
for every example. ``:name:`` is the `Sphinx*`_ name that allows referencing example from other parts of the documentation. It is a good
281-
tone to include this field. Please follow the naming convention ``ex_<example file name>`` for consistency.
282-
283-
Accompany every example with the expected output using ``.. code-block:: console`` decorator.
284-
285-
286-
**Every Examples section must come with one or more examples illustrating all major variations of supported API parameter combinations. It is highly recommended to illustrate SDC API limitations (e.g. unsupported parameters) in example script comments.**
287-
288-
9. See Also sections are highly encouraged.
289-
This is a good practice to include relevant references into the See Also section. Embedding references which are not directly
290-
related to the topic may be distructing if those appear across API description. A good style is to have a dedicated section for
291-
relevant topics.
292-
293-
See Also section may include references to relevant SDC and Pandas as well as to external topics.
294-
295-
A special form of See Also section is References to publications. Pandas documentation sometimes uses References section to refer to
296-
external projects. While it is not prohibited to use References section in SDC docstrings, it is better to combine all references
297-
under See Also umbrella.
298-
299-
10. Notes and Warnings must be decorated with ``.. note::`` and ``.. warning::`` respectively.
300-
Do not use
301-
::
302-
Notes
303-
-----
304-
305-
Warning
306-
-------
307-
308-
Pay attention to indentation and required blank lines. `Sphinx*`_ is very sensitive to that.
309-
310-
11. If SDC API does not support all variations of respective Pandas API then Limitations section is mandatory.
311-
While there is not specific guideline how Limitations section must be written, a good style is to follow Pandas Parameters section
312-
description style and naming conventions.
313173

314-
12. Before committing your code for public SDC API you are expected to:
174+
More information about building and adding documentation can be found `here <docs/README.rst>`_.
315175

316-
- have SDC docstring implemented;
317-
- have respective SDC examples implemented and tested
318-
- API Reference documentation generated and visually inspected. New warnings in the documentation build are not allowed.
319176

320177
Running unit tests
321178
------------------

buildscripts/autogen_sources.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777

7878
arithmetic_binops_symbols = {
7979
'add': '+',
80+
'div': '/',
8081
'sub': '-',
8182
'mul': '*',
8283
'truediv': '/',
@@ -117,9 +118,11 @@
117118
import_section_text = ''.join(module_text_lines[imports_start_line: import_end_line + 1])
118119

119120
# read function templates for arithmetic and comparison operators from templates module
120-
template_series_arithmetic_binop = inspect.getsource(templates_module.sdc_pandas_series_operator_binop)
121-
template_series_comparison_binop = inspect.getsource(templates_module.sdc_pandas_series_operator_comp_binop)
122-
template_str_arr_comparison_binop = inspect.getsource(templates_module.sdc_str_arr_operator_comp_binop)
121+
template_series_binop = inspect.getsource(templates_module.sdc_pandas_series_binop)
122+
template_series_comp_binop = inspect.getsource(templates_module.sdc_pandas_series_comp_binop)
123+
template_series_operator = inspect.getsource(templates_module.sdc_pandas_series_operator_binop)
124+
template_series_comp_operator = inspect.getsource(templates_module.sdc_pandas_series_operator_comp_binop)
125+
template_str_arr_comp_binop = inspect.getsource(templates_module.sdc_str_arr_operator_comp_binop)
123126

124127
exit_status = -1
125128
try:
@@ -133,19 +136,32 @@
133136
# certaing modifications are needed to be applied for templates, so
134137
# verify correctness of produced code manually
135138
for name in arithmetic_binops_symbols:
136-
func_text = template_series_arithmetic_binop.replace('binop', name)
139+
func_text = template_series_binop.replace('binop', name)
137140
func_text = func_text.replace(' + ', f' {arithmetic_binops_symbols[name]} ')
138-
func_text = func_text.replace('def ', f'@sdc_overload(operator.{name})\ndef ', 1)
141+
func_text = func_text.replace('def ', f"@sdc_overload_method(SeriesType, '{name}')\ndef ", 1)
139142
file.write(f'\n\n{func_text}')
140143

141144
for name in comparison_binops_symbols:
142-
func_text = template_series_comparison_binop.replace('comp_binop', name)
145+
func_text = template_series_comp_binop.replace('comp_binop', name)
146+
func_text = func_text.replace(' < ', f' {comparison_binops_symbols[name]} ')
147+
func_text = func_text.replace('def ', f"@sdc_overload_method(SeriesType, '{name}')\ndef ", 1)
148+
file.write(f'\n\n{func_text}')
149+
150+
for name in arithmetic_binops_symbols:
151+
if name != "div":
152+
func_text = template_series_operator.replace('binop', name)
153+
func_text = func_text.replace(' + ', f' {arithmetic_binops_symbols[name]} ')
154+
func_text = func_text.replace('def ', f'@sdc_overload(operator.{name})\ndef ', 1)
155+
file.write(f'\n\n{func_text}')
156+
157+
for name in comparison_binops_symbols:
158+
func_text = template_series_comp_operator.replace('comp_binop', name)
143159
func_text = func_text.replace(' < ', f' {comparison_binops_symbols[name]} ')
144160
func_text = func_text.replace('def ', f'@sdc_overload(operator.{name})\ndef ', 1)
145161
file.write(f'\n\n{func_text}')
146162

147163
for name in comparison_binops_symbols:
148-
func_text = template_str_arr_comparison_binop.replace('comp_binop', name)
164+
func_text = template_str_arr_comp_binop.replace('comp_binop', name)
149165
func_text = func_text.replace(' < ', f' {comparison_binops_symbols[name]} ')
150166
if name == 'ne':
151167
func_text = func_text.replace('and not', 'or')

buildscripts/build.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535

3636
def build(sdc_utils):
3737
os.chdir(str(sdc_utils.src_path))
38-
# For Windows build do not use intel channel due to build issue
39-
if platform.system() == 'Windows':
40-
sdc_utils.channels = '-c intel/label/beta -c defaults -c conda-forge'
4138

4239
sdc_utils.log_info('Start Intel SDC build', separate=True)
4340
conda_build_cmd = ' '.join([

buildscripts/run_examples.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def run_examples(sdc_utils):
9090
sdc_utils.log_info('Run Intel(R) SDC examples', separate=True)
9191
sdc_utils.log_info(sdc_utils.line_double)
9292
sdc_utils.create_environment()
93-
sdc_utils.install_conda_package(['sdc'])
93+
sdc_package = f'sdc={sdc_utils.get_sdc_version_from_channel()}'
94+
sdc_utils.install_conda_package([sdc_package])
9495

9596
run_examples(sdc_utils)

buildscripts/sdc-conda-recipe/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{% set NUMBA_VERSION = "==0.48" %}
1+
{% set NUMBA_VERSION = "==0.49.1" %}
22
{% set PANDAS_VERSION = "==0.25.3" %}
3-
{% set PYARROW_VERSION = "==0.15.1" %}
3+
{% set PYARROW_VERSION = "==0.17.0" %}
44

55
package:
66
name: sdc

buildscripts/sdc-conda-recipe/run_test.bat

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,35 @@ if errorlevel 1 exit 1
99

1010
@rem TODO investigate root cause of NumbaPerformanceWarning
1111
@rem http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics
12-
python -W ignore -u -m sdc.runtests -v
12+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_basic
13+
if errorlevel 1 exit 1
14+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_series
15+
if errorlevel 1 exit 1
16+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_dataframe
17+
if errorlevel 1 exit 1
18+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_hiframes
19+
if errorlevel 1 exit 1
20+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_date
21+
if errorlevel 1 exit 1
22+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_strings
23+
if errorlevel 1 exit 1
24+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_groupby
25+
if errorlevel 1 exit 1
26+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_join
27+
if errorlevel 1 exit 1
28+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_rolling
29+
if errorlevel 1 exit 1
30+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_ml
31+
if errorlevel 1 exit 1
32+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_io
33+
if errorlevel 1 exit 1
34+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_hpat_jit
35+
if errorlevel 1 exit 1
36+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_sdc_numpy
37+
if errorlevel 1 exit 1
38+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_prange_utils
1339
if errorlevel 1 exit 1
1440

1541
REM Link check for Documentation using Sphinx's in-built linkchecker
1642
REM sphinx-build -b linkcheck -j1 usersource _build/html
1743
REM if errorlevel 1 exit 1
18-

buildscripts/sdc-conda-recipe/run_test.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,17 @@ python -m sdc.tests.gen_test_data
1313

1414
# TODO investigate root cause of NumbaPerformanceWarning
1515
# http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics
16-
python -W ignore -u -m sdc.runtests -v
16+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_basic
17+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_series
18+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_dataframe
19+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_hiframes
20+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_date
21+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_strings
22+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_groupby
23+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_join
24+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_rolling
25+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_ml
26+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_io
27+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_hpat_jit
28+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_sdc_numpy
29+
python -W ignore -u -m sdc.runtests -v sdc.tests.test_prange_utils

buildscripts/utilities.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727

2828

29+
import json
2930
import os
3031
import platform
3132
import re
@@ -51,7 +52,7 @@ def __init__(self, python, sdc_local_channel=None):
5152
self.line_single = '-'*80
5253

5354
# Set channels
54-
self.channel_list = ['-c', 'intel/label/beta', '-c', 'intel', '-c', 'defaults', '-c', 'conda-forge']
55+
self.channel_list = ['-c', 'intel/label/beta', '-c', 'defaults', '-c', 'conda-forge']
5556
if sdc_local_channel:
5657
sdc_local_channel = Path(sdc_local_channel).resolve().as_uri()
5758
self.channel_list = ['-c', sdc_local_channel] + self.channel_list
@@ -87,7 +88,7 @@ def create_environment(self, packages_list=[]):
8788
# Create Intel SDC environment
8889
create_args = ['-q', '-y', '-n', self.env_name, f'python={self.python}']
8990
create_args += packages_list + self.channel_list + ['--override-channels']
90-
self.__run_conda_command(Conda_Commands.CREATE, create_args)
91+
self.log_info(self.__run_conda_command(Conda_Commands.CREATE, create_args))
9192

9293
return
9394

@@ -97,7 +98,7 @@ def install_conda_package(self, packages_list):
9798
self.log_info(f'Install {" ".join(packages_list)} to {self.env_name} conda environment')
9899
install_args = ['-n', self.env_name]
99100
install_args += self.channel_list + ['--override-channels', '-q', '-y'] + packages_list
100-
self.__run_conda_command(Conda_Commands.INSTALL, install_args)
101+
self.log_info(self.__run_conda_command(Conda_Commands.INSTALL, install_args))
101102

102103
return
103104

@@ -135,3 +136,19 @@ def log_info(self, msg, separate=False):
135136
if separate:
136137
print(f'{time.strftime("%d/%m/%Y %H:%M:%S")}: {self.line_double}', flush=True)
137138
print(f'{time.strftime("%d/%m/%Y %H:%M:%S")}: {msg}', flush=True)
139+
140+
def get_sdc_version_from_channel(self):
141+
python_version = 'py' + self.python.replace('.', '')
142+
143+
# Get Intel SDC version from first channel in channel_list
144+
search_args = ['sdc', '-c', self.channel_list[1], '--override-channels', '--json']
145+
search_result = self.__run_conda_command(Conda_Commands.SEARCH, search_args)
146+
147+
repo_data = json.loads(search_result)
148+
for package_data in repo_data['sdc']:
149+
sdc_version = package_data['version']
150+
sdc_build = package_data['build']
151+
if python_version in sdc_build:
152+
break
153+
154+
return f'{sdc_version}={sdc_build}'

0 commit comments

Comments
 (0)