#FAILED [100%]Parameters used = F:/jupyter/pypownet-master/tests/parameters/default14_for_tests/
Agent_test_InputLoadValues created.
tests\test_simulate.py:538 (test_simulate_Agent_test_AccurateConsumptionLoadings)
def test_simulate_Agent_test_AccurateConsumptionLoadings():
"This function creates an Agent
"
parameters = "F:/jupyter/pypownet-master/tests/parameters/default14_for_tests/"
print("Parameters used = ", parameters)
game_level = "level0"
loop_mode = "natural"
start_id = 0
game_over_mode = "soft"
renderer_latency = 1
render = False
# render = True
niter = 3
env_class = RunEnv
# Instantiate environment and agent
env = env_class(parameters_folder=parameters, game_level=game_level,
chronic_looping_mode=loop_mode, start_id=start_id,
game_over_mode=game_over_mode, renderer_latency=renderer_latency)
agent = Agent_test_AccurateConsumptionLoadings(env)
test_simulate.py:559:
_
test_simulate.py:250: in init
self.from_file_loads_content = get_n_first_lines_from_csv(5, self.abspath)
test_simulate.py:9: in get_n_first_lines_from_csv
content = np.genfromtxt(csv_file_path, np.float32, delimiter=";")
\venv\lib\site-packages\numpy\lib\npyio.py:1700: in genfromtxt
fhd = iter(np.lib._datasource.open(fname, 'rt', encoding=encoding))
\venv\lib\site-packages\numpy\lib_datasource.py:260: in open
return ds.open(path, mode, encoding=encoding, newline=newline)
_
self = <numpy.lib._datasource.DataSource object at 0x1C19ED30>
path = 'F:\jupyter\pypownet-master\tests\tests\parameters\default14_for_tests\level0\chronics\a\_N_loads_p.csv'
mode = 'rt', encoding = None, newline = None
def open(self, path, mode='r', encoding=None, newline=None):
"
Open and return file-like object.
If `path` is an URL, it will be downloaded, stored in the
`DataSource` directory and opened from there.
Parameters
-
path : str
Local file path or URL to open.
mode : {'r', 'w', 'a'}, optional
Mode to open `path`. Mode 'r' for reading, 'w' for writing,
'a' to append. Available modes depend on the type of object
specified by `path`. Default is 'r'.
encoding : {None, str}, optional
Open text file with given encoding. The default encoding will be
what `io.open` uses.
newline : {None, str}, optional
Newline to use when reading text file.
Returns
-
out : file object
File object.
"
# TODO: There is no support for opening a file for writing which
# doesn't exist yet (creating a file). Should there be?
# TODO: Add a ``subdir`` parameter for specifying the subdirectory
# used to store URLs in self._destpath.
if self._isurl(path) and self._iswritemode(mode):
raise ValueError("URLs are not writeable")
# NOTE: _findfile will fail on a new file opened for writing.
found = self._findfile(path)
if found:
_fname, ext = self._splitzipext(found)
if ext == 'bz2':
mode.replace("+", "")
return _file_openers[ext](found, mode=mode,
encoding=encoding, newline=newline)
else:
raise IOError("%s not found." % path)
E OSError: F:\jupyter\pypownet-master\tests\tests\parameters\default14_for_tests\level0\chronics\a_N_loads_p.csv not found.
\venv\lib\site-packages\numpy\lib_datasource.py:616: OSError
代码贴的有些乱
建议用 插入代码块功能
看信息, 是不是这个文件不存在, 还是文件名的写法有问题
F:\jupyter\pypownet-master\tests\tests\parameters\default14_for_tests\level0\chronics\a_N_loads_p.csv
改成这样试试
path = r'F:\jupyter\pypownet-master\tests\tests\parameters\default14_for_tests\level0\chronics\a\_N_loads_p.csv'