o
    tf                     @  s   U d dl mZ d dlZd dlmZmZmZ d dlZd dl	m
Z
 eejed f Zed Zi ddd	d
dddddddddd
dddddddddddddddddddd
dd
ddZded< d	dddddddZd-d d!Zed"Zd.d&d'Zed(e
d)Zd/d+d,ZdS )0    )annotationsN)LiteralTypeVarUnion)	BaseModelZheatmap)centertopleftbottomr   ZwholeZgalleryz
1d-heatmapr   2d-rectangle-domainsr   barbedlikezchromosome-labelsgene-annotationszhorizontal-1d-heatmapzhorizontal-barzhorizontal-chromosome-labelszhorizontal-gene-annotationszhorizontal-heatmapzhorizontal-linezhorizontal-multivecz	left-axisr	   linez	osm-tiles)ztop-axiszviewport-projection-centerzviewport-projection-horizontalzdict[str, TrackPosition]track_default_position)r   r   Z
chromsizesr   matrixZmultivecZvectorreturnstrc                   C  s   t t S )N)r   uuiduuid4 r   r   W/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/higlass/_utils.pyuid.   s   r   TxT | list[T] | Nonelist[T]c                 C  s    | du rg S t | tr| S | gS )zEnsures that x is a list.

    Parameters
    ----------
    x : T | list[T] | None
        The object to be converted to a list.

    Returns
    -------
    list[T]
        The object as a list.
    N)
isinstancelist)r   r   r   r   ensure_list5   s   r   ModelT)boundmodelc                 C  s0   | j di |  }t|drt|dt  |S )z9Creates a deep copy of a pydantic BaseModel with new UID.r   Nr   )	__class__dicthasattrsetattrr   )r"   copyr   r   r   copy_uniqueJ   s   
r(   )r   r   )r   r   r   r   )r"   r    r   r    )
__future__r   r   typingr   r   r   Zhiglass_schemaZhgsZpydanticr   ZEnumTrackTypeZ	TrackTypeZTrackPositionr   __annotations__Zdatatype_default_trackr   r   r   r    r(   r   r   r   r   <module>   sv    	


