第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

旋轉(zhuǎn)錯(cuò)誤:失敗,退出狀態(tài)為 2。麻木和皮維斯塔

旋轉(zhuǎn)錯(cuò)誤:失敗,退出狀態(tài)為 2。麻木和皮維斯塔

翻閱古今 2022-09-20 17:22:16
我想對(duì)以下代碼進(jìn)行西頓化,但我收到一個(gè)錯(cuò)誤。import numpy as npcimport numpy as npimport pyvista as pvfrom mesh_funcs import *cimport cython from libcpp cimport bool#import matplotlib.pyplot as plt#Getting mesh points from pyvista unfortunately with a for loopcdef class pv_cell:    def pv_grid_cell_data(mesh2,bool points_toggle=True,                          bool centres_toggle=True,bool volumes_toggle=True, bool areas_toggle=True):        if areas_toggle==True:            points_toggle==True        if centres_toggle==True:            points_toggle==True        cdef np.ndarray gcp=np.zeros([mesh2.n_cells,8,3])        cdef np.ndarray gcc=np.zeros([mesh2.n_cells,3])        cdef np.ndarray gcv=np.zeros([mesh2.n_cells,3])        cdef np.ndarray grid_facets=np.array([[0,1,2,3], [0,1,5,4], [1,2,6,5], [7,6,2,3], [7,3,0,4], [4,5,6,7]])        cdef np.ndarray gca=np.zeros([mesh2.n_cells,6])        for n1 in range(0,mesh2.n_cells):            if points_toggle==True:                gcp[n1]=mesh2.extract_cells(n1).points            if centres_toggle==True:                gcc[n1]=[np.mean(gcp[n1][:,0]),np.mean(gcp[n1][:,1]),np.mean(gcp[n1][:,2])]            if volumes_toggle==True:                gcv[n1]=mesh2.extract_cells(n1).compute_cell_sizes()["Volume"]            if areas_toggle==True:                for n2 in range(0,6):                    ph8=gcp[n1][grid_facets[n2]]                    gca[n1,n2]=tri_area(ph8[[0,2,3]])+tri_area(ph8[[0,1,3]])        return gcp,gcc,gcv,gca我的 setup.py 如下from setuptools import setupfrom Cython.Build import cythonizeimport numpysetup(    ext_modules=cythonize("pv_cell_funcs.pyx"),include_dirs=[numpy.get_include()])我通過以下方式啟動(dòng) setup.py。python setup.py build_ext --inplacepause錯(cuò)誤很長(zhǎng)。它聲明 bool 是一個(gè)未聲明的標(biāo)識(shí)符。然后它列出了許多語法錯(cuò)誤。最后一行是error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\...x64\\cl.exe' failed with exit status 2在此處輸入圖像描述
查看完整描述

1 回答

?
慕標(biāo)琳琳

TA貢獻(xiàn)1830條經(jīng)驗(yàn) 獲得超9個(gè)贊

由于您正在運(yùn)行:


from libcpp cimport bool

您應(yīng)該將語言從默認(rèn)語言更改為:cc++setup.py


from setuptools import setup

from Cython.Build import cythonize

import numpy


setup(

    ext_modules=cythonize("pv_cell_funcs.pyx", language='c++'),

    include_dirs=[numpy.get_include()])

請(qǐng)參閱如何聲明 bool 類型的對(duì)象?以便在 cython 中使用。bool


查看完整回答
反對(duì) 回復(fù) 2022-09-20
  • 1 回答
  • 0 關(guān)注
  • 95 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)