
    ꢩeHZ                         d Z ddlZddlZddlZddlmZ  eg d          Zd e                                D             Z	d Z
d Zedk    r e             dS dS )	z_This utility helps you migrate from PyTables 2.x APIs to 3.x APIs, which
are PEP 8 compliant.

    N)Path(  )hdf5Versionhdf5_version)
parentNode
parentnode)getEnumget_enum)	_initLoop
_init_loop)_fancySelection_fancy_selection)_checkShape_check_shape)
_readSlice_read_slice)_readCoords_read_coords)_readSelection_read_selection)_writeSlice_write_slice)_writeCoords_write_coords)_writeSelection_write_selection)_g_copyWithStats_g_copy_with_stats)
_c_classId
_c_classid)
_checkBase
_checkbase)newSetnewset)	copyClass	copyclass)_g_updateNodeLocation_g_update_node_location)	_g_logAdd
_g_log_add)_g_delAndLog_g_del_and_log)_v__nodeFile_v__nodefile)_v__nodePath_v__nodepath)_g_setNestedNamesDescr_g_set_nested_names_descr)_g_setPathNames_g_set_path_names)_v_colObjects_v_colobjects)_v_nestedFormats_v_nested_formats)_v_nestedNames_v_nested_names)_v_nestedDescr_v_nested_descr)getColsInOrderget_cols_in_order)	joinPaths
join_paths)metaIsDescriptionMetaIsDescription)_checkShapeAppend_check_shape_append)_exprvarsCache_exprvars_cache)_requiredExprVars_required_expr_vars)setInputsRangeset_inputs_range)	setOutput
set_output)setOutputRangeset_output_range)	_opToCode_op_to_code)	_codeToOp_code_to_op)_transVersion_trans_version)_transGroupParent_trans_group_parent)_transGroupName_trans_group_name)_transGroupPath_trans_group_path)_actionLogParent_action_log_parent)_actionLogName_action_log_name)_actionLogPath_action_log_path)_transParent_trans_parent)
_transName_trans_name)
_transPath_trans_path)_shadowParent_shadow_parent)_shadowName_shadow_name)_shadowPath_shadow_path)copyFile	copy_file)openFile	open_file_getValueFromContainer_get_value_from_container)__getRootGroup__get_root_group)rootUEProot_uep)_getOrCreatePath_get_or_create_path)_createPath_create_path)createGroupcreate_group)createTablecreate_table)createArraycreate_array)createCArraycreate_carray)createEArraycreate_earray)createVLArraycreate_vlarray)createHardLinkcreate_hard_link)createSoftLinkcreate_soft_link)createExternalLinkcreate_external_link)_getNode	_get_node)getNodeget_node)isVisibleNodeis_visible_node)
renameNoderename_node)moveNode	move_node)copyNode	copy_node)
removeNoderemove_node)getNodeAttrget_node_attr)setNodeAttrset_node_attr)delNodeAttrdel_node_attr)copyNodeAttrscopy_node_attrs)copyChildrencopy_children)	listNodes
list_nodes)	iterNodes
iter_nodes)	walkNodes
walk_nodes)
walkGroupswalk_groups)
_checkOpen_check_open)_isWritable_iswritable)_checkWritable_check_writable)_checkGroup_check_group)isUndoEnabledis_undo_enabled)_checkUndoEnabled_check_undo_enabled)_createTransactionGroup_create_transaction_group)_createTransaction_create_transaction)_createMark_create_mark)
enableUndoenable_undo)disableUndodisable_undo)
_getMarkID_get_mark_id)_getFinalAction_get_final_action)getCurrentMarkget_current_mark)_updateNodeLocations_update_node_locationsrp   )_g_postInitHook_g_post_init_hook)_g_getChildGroupClass_g_get_child_group_class)_g_getChildLeafClass_g_get_child_leaf_class)_g_addChildrenNames_g_add_children_names)_g_checkHasChild_g_check_has_child)_f_walkNodes_f_walknodes)_g_widthWarning_g_width_warning)
_g_refNode
_g_refnode)_g_unrefNode_g_unrefnode)_g_copyChildren_g_copy_children)_f_getChild_f_get_child)_f_listNodes_f_list_nodes)_f_iterNodes_f_iter_nodes)_f_walkGroups_f_walk_groups)_g_closeDescendents_g_close_descendents)_f_copyChildren_f_copy_children)_v_maxGroupWidth_v_max_group_width)_v_objectID_v_objectid)_g_loadChild_g_load_child)	childName	childname)_c_shadowNameRE_c_shadow_name_re)hdf5Extensionhdf5extension)
_getFileId_get_file_id)
_flushFile_flush_file)
_closeFile_close_file)_g_listAttr_g_list_attr)
_g_setAttr
_g_setattr)
_g_getAttr
_g_getattr)_g_listGroup_g_list_group)_g_getGChildAttr_g_get_gchild_attr)_g_getLChildAttr_g_get_lchild_attr)_g_flushGroup_g_flush_group)_g_closeGroup_g_close_group)_g_moveNode_g_move_node)_convertTime64_convert_time64)_createArray_create_array)_createCArray_create_carray)
_openArray_open_array)
_readArray_read_array)_g_readSlice_g_read_slice)_g_readCoords_g_read_coords)_g_readSelection_g_read_selection)_g_writeSlice_g_write_slice)_g_writeCoords_g_write_coords)_g_writeSelection_g_write_selection)calcChunksizecalc_chunksize)	infinityF	infinityf)infinityMapinfinitymap)infTypeinftype)StringNextAfterstring_next_after)IntTypeNextAfterint_type_next_after)BoolTypeNextAfterbool_type_next_after)defaultAutoIndexdefault_auto_index)defaultIndexFiltersdefault_index_filters)_tableColumnPathnameOfIndex_table_column_pathname_of_index)_is_CSI_is_csi)is_CSIis_csi)appendLastRowappend_last_row)read_sliceLRread_slice_lr)
readSortedread_sorted)readIndicesread_indices)_processRange_process_range)searchLastRowsearch_last_row)getLookupRangeget_lookup_range)_g_checkName_g_check_name)
_searchBin_search_bin)indexesExtensionindexesextension)initReadinitread)	readSlice
read_slice)_readIndexSlice_read_index_slice)_initSortedSlice_init_sorted_slice)_g_readSortedSlice_g_read_sorted_slice)_readSortedSlice_read_sorted_slice)getLRUboundsget_lru_bounds)getLRUsortedget_lru_sorted)_searchBinNA_b_search_bin_na_b)_searchBinNA_ub_search_bin_na_ub)_searchBinNA_s_search_bin_na_s)_searchBinNA_us_search_bin_na_us)_searchBinNA_i_search_bin_na_i)_searchBinNA_ui_search_bin_na_ui)_searchBinNA_ll_search_bin_na_ll)_searchBinNA_ull_search_bin_na_ull)_searchBinNA_e_search_bin_na_e)_searchBinNA_f_search_bin_na_f)_searchBinNA_d_search_bin_na_d)_searchBinNA_g_search_bin_na_g)objectID	object_id)_processRangeRead_process_range_read)_pointSelection_point_selection)	isVisible	isvisible)getAttrget_attr)setAttrset_attr)delAttrdel_attr)_g_getLinkClass_g_get_link_class)linkExtensionlinkextension)_getLinkClass_get_link_class)_g_createHardLink_g_create_hard_link)lrucacheExtensionlrucacheextension)_checkAndSetPair_check_and_set_pair)_getContainer_get_container)containerRefcontainerref)_g_logCreate_g_log_create)_g_preKillHook_g_pre_kill_hook)_g_checkOpen_g_check_open)_g_setLocation_g_set_location)_g_updateLocation_g_update_location)_g_delLocation_g_del_location)_g_updateDependent_g_update_dependent)_g_removeAndLog_g_remove_and_log)
_g_logMove_g_log_move)oldPathnameoldpathname)_g_copyAsChild_g_copy_as_child)_f_isVisible_f_isvisible)_g_checkGroup_g_check_group)_g_checkNotContains_g_check_not_contains)_g_maybeRemove_g_maybe_remove)
_f_getAttr
_f_getattr)
_f_setAttr
_f_setattr)
_f_delAttr
_f_delattr)_v_maxTreeDepth_v_maxtreedepth)newNodenew_node)openNode	open_node)_lineChunkSize_line_chunksize)_lineSeparator_line_separator)_notReadableError_not_readable_error)_appendZeros_append_zeros)getAttrs
_get_attrs)setAttrs
_set_attrs)delAttrs
_del_attrs)_setAttributes_set_attributes)_checkAttributes_check_attributes)_checkNotClosed_check_not_closed)__allowedInitKwArgs__allowed_init_kwargs)
_byteShape_byte_shape)_sizeToShape_size_to_shape)_vType_vtype)_vShape_vshape)
parentPath
parentpath)_pythonIdRE_python_id_re)_reservedIdRE_reserved_id_re)_hiddenNameRE_hidden_name_re)_hiddenPathRE_hidden_path_re)checkNameValiditycheck_name_validity)joinPath	join_path)	splitPath
split_path)isVisibleNameisvisiblename)isVisiblePathisvisiblepath)	className	classname)classNameDictclass_name_dict)classIdDictclass_id_dict)getClassByNameget_class_by_name)dumpLeaf	dump_leaf)	dumpGroup
dump_group)newdstGroupnewdst_group)recreateIndexesrecreate_indexes)copyLeaf	copy_leaf)_nxTypeFromNPType_nxtype_from_nptype)_npSizeType_npsizetype)_indexNameOf_index_name_of)_indexPathnameOf_index_pathname_of)_indexPathnameOfColumn_index_pathname_of_column)_indexNameOf__index_name_of_)_indexPathnameOf__index_pathname_of_)_indexPathnameOfColumn__index_pathname_of_column_)_table__setautoIndex_table__setautoindex)_table__getautoIndex_table__getautoindex)_table__autoIndex_table__autoindex)_table__whereIndexed_table__where_indexed)createIndexesTablecreate_indexes_table)createIndexesDescrcreate_indexes_descr)_column__createIndex_column__create_index)
_autoIndex
_autoindex)	autoIndex	autoindex)	_useIndex
_use_index)_whereCondition_where_condition)_conditionCache_condition_cache)_enabledIndexingInQueries_enabled_indexing_in_queries)_emptyArrayCache_empty_array_cache)_getTypeColNames_get_type_col_names)_getEnumMap_get_enum_map)_cacheDescriptionData_cache_description_data)_getColumnInstance_get_column_instance)_checkColumn_check_column)_disableIndexingInQueries_disable_indexing_in_queries)_enableIndexingInQueries_enable_indexing_in_queries)_getConditionKey_get_condition_key)_compileCondition_compile_condition)willQueryUseIndexingwill_query_use_indexing)	readWhere
read_where)whereAppendappend_where)getWhereListget_where_list)_check_sortby_CSI_check_sortby_csi)_readCoordinates_read_coordinates)readCoordinatesread_coordinates)_saveBufferedRows_save_buffered_rows)modifyCoordinatesmodify_coordinates)
modifyRowsmodify_rows)modifyColumnmodify_column)modifyColumnsmodify_columns)flushRowsToIndexflush_rows_to_index)_addRowsToIndex_add_rows_to_index)
removeRowsremove_rows)_setColumnIndexing_set_column_indexing)_markColumnsAsDirty_mark_columns_as_dirty)_reIndex_reindex)
_doReIndex_do_reindex)reIndexreindex)reIndexDirtyreindex_dirty)_g_copyRows_g_copy_rows)_g_copyRows_optim_g_copy_rows_optim)_g_propIndexes_g_prop_indexes)_g_updateTableLocation_g_update_table_location)
_tableFile_table_file)
_tablePath_table_path)createIndexcreate_index)createCSIndexcreate_csindex)removeIndexremove_index)tableExtensiontableextension)getNestedFieldCacheget_nested_field_cache)getNestedTypeget_nested_type)_createTable_create_table)_getInfo	_get_info)
indexChunk
indexchunk)
indexValid
indexvalid)indexValuesindexvalues)bufcoordsDatabufcoords_data)indexValuesDataindex_values_data)chunkmapDatachunkmap_data)indexValidDataindex_valid_data)	whereCond	wherecond)iterseqMaxElementsiterseq_max_elements)IObufiobuf)IObufcpyiobufcpy)_convertTime64__convert_time64_)_convertTypes_convert_types)
_newBuffer_new_buffer)__next__inKernel__next__inkernel)_fillCol	_fill_col)_flushBufferedRows_flush_buffered_rows)_getUnsavedNrows_get_unsaved_nrows)_flushModRows_flush_mod_rows)moveToShadowmove_to_shadow)moveFromShadowmove_from_shadow)
undoCreateundo_create)
redoCreateredo_create)
undoRemoveundo_remove)
redoRemoveredo_remove)undoMove	undo_move)redoMove	redo_move)attrToShadowattr_to_shadow)attrFromShadowattr_from_shadow)undoAddAttrundo_add_attr)redoAddAttrredo_add_attr)undoDelAttrundo_del_attr)redoDelAttrredo_del_attr)convertToNPAtomconvert_to_np_atom)convertToNPAtom2convert_to_np_atom2)checkFileAccesscheck_file_access)logInstanceCreationlog_instance_creation)fetchLoggedInstancesfetch_logged_instances)countLoggedInstancescount_logged_instances)listLoggedInstanceslist_logged_instances)dumpLoggedInstancesdump_logged_instances)detectNumberOfCoresdetect_number_of_cores)utilsExtensionutilsextension)PTTypeToHDF5pttype_to_hdf5)PTSpecialKindspt_special_kinds)NPExtPrefixesToPTKindsnpext_prefixes_to_ptkinds)HDF5ClassToStringhdf5_class_to_string)setBloscMaxThreadsset_blosc_max_threads)silenceHDF5Messagessilence_hdf5_messages)
isHDF5Fileis_hdf5_file)isPyTablesFileis_pytables_file)getHDF5Versionget_hdf5_version)getPyTablesVersionget_pytables_version)whichLibVersionwhich_lib_version)
whichClasswhich_class)getNestedFieldget_nested_field)
getFiltersget_filters)getTypeEnumget_type_enum)enumFromHDF5enum_from_hdf5)
enumToHDF5enum_to_hdf5)AtomToHDF5Typeatom_to_hdf5_type)loadEnum	load_enum)HDF5ToNPNestedTypehdf5_to_np_nested_type)HDF5ToNPExtTypehdf5_to_np_ext_type)AtomFromHDF5Typeatom_from_hdf5_type)createNestedTypecreate_nested_type)_openUnImplemented_open_unimplementedc                     i | ]\  }}||	S  r  ).0kvs      5lib/python3.11/site-packages/tables/scripts/pt2to3.py
<dictcomp>r    s    666A1666    c                     | j         rt          nt          d                    d                    t                                        }| j        r|dz  }|dz  }|dz  }|dz  }t          j        |t          j	                  }fd}||fS )	Nz(?<=\W)({})(?=\W)|z'(?!\s*?=\s*?previous_api(_property)?\()z(?!\* to \*\w+\*)z0(?!\* parameter has been renamed into \*\w+\*\.)z1(?! is pending deprecation, import \w+ instead\.))flagsc                 |                         |                     d          |                     d                    S )N   r   )getgroup)mnamess    r  replzmake_subs.<locals>.repl  s+    yyQWWQZZ000r  )
reversenew2oldnamesold2newnamesformatjoinlistignore_previousrecompile	MULTILINE)nsssubsr   r  s       @r  	make_subsr.    s    J8LLLE##CHHT%[[$9$9::A	 B	77	!!	@@	AA:ar|,,,D1 1 1 1 1:r  c                  R   d} t          j        |           }|                    dddddd	           |                    d
ddddd	           |                    dd dd           |                    dddddd	           |                    dd           |                                }t	          |j                                                  st          j        d|j        d           t	          |j                  	                                }t          |          \  }}|                    ||          }|j        r|j        n|j        |_        |j        !t          j                            |           d S t	          |j                                      |           d S )NzPyTables 2.x -> 3.x API transition tool

This tool displays to standard out, so it is 
common to pipe this to another file:

$ pt2to3 oldfile.py > newfile.py)descriptionz-rz	--reverse
store_trueFr!  z'reverts changes, going from 3.x -> 2.x.)actiondefaultdesthelpz-pz--no-ignore-previousstore_falseTr'  zignores previous_api() calls.z-ooutputzoutput file to write to.)r3  r4  r5  z-iz	--inplaceinplacezoverwrites the file in-place.filenamezpath to input file.)r5  zfile z
 not found)argparseArgumentParseradd_argument
parse_argsr   r9  is_filesysexit	read_textr.  subr8  r7  stdoutwrite
write_text)descparserr+  srcr-  r   targs          r  mainrJ    s   /D $666F
k,&F  H H H 4] $+<<  > > > d7  9 9 9
k,&-L  N N N

)>???					B$$&& 42222333
r{


%
%
'
'C2JD$88D#D!z8ryBI	y
RY""4(((((r  __main__)__doc__r(  r?  r:  pathlibr   dictr#  itemsr"  r.  rJ  __name__r  r  r  <module>rQ     s     
			 



       t } } } } }~ 76!3!3!5!5666  ) ) )B zDFFFFF r  