Skip to main content

A simple, parameterized cloud model

Project description

README

Table of Contents

-- Installation -- Usage

Python

Instalation

To install as a pip package:

    pip install -i https://test.pypi.org/simple/ cloudmodel

Usage

To run the model, first import it from the library

    from cloudmodel import CloudModel

and call it with the desired parameters

CloudModel(
    simulation_time_minutes,  #(int): The total simulation time in minutes.
    save_time_minutes,  # (int): The time interval in minutes at which the model state is saved.
    statistic_time_minutes,  # (int): The time interval in minutes at which statistics are calculated.
    bacup_time_minutes,  # (int): The time interval in minutes at which backups are created.
)

When the model finishes running there will be a new directory, where all the output data from the simulation will be stored.

The following section describes all the functions that can be applied to those simulation results.

Features

class FileStyle:
    """A class representing the file style for cloud data.

    Attributes:
        chosen_file (str): The chosen input file type.
        output_data_path (str): The path to the output data folder.
        cmp_output_data_path (str): The path to the comparison output data folder.
        img_path (str): The path to the image folder.
        txt_path (str): The path to the text folder.
        cmp_txt_path (str): The path to the comparison text folder.
        vid_path (str): The path to the video folder.
        img_option (str): The image style option.
        folder_handle (str): The folder handling option.

    Methods:
        _get_data(): Get the data from the selected files.
        _get_var_from_data(file_number, var_iterator): Get a specific variable from the data.
        list_var(): List all the variables.
        get_var(var, time): Get a specific variable at a given time.
        show_var_dataframe(var_array, center, axes): Show the variable data as a DataFrame.
        center_var(var_array, center, axes): Center the variable data along a specific axes.
        get_var_max_value_position(var_array): Get the position of the maximum value in the variable data.
        check_path(path, selected_file_name): Check if the path exists and create it if necessary.
        cloud_binary_comparison(): Compare the binary files in the output data and comparison output data folders.
        live_var_animation(variable): Create a live animation of a variable.
        plot_style(variable): Plot the style of a variable.
        generate_image(frame, var_number): Generate an image for a specific frame and variable.
        animate_variables(var_list, save_animation, show_animation): Animate multiple variables.
        animate_variable(var_to_animate, save_animation, show_animation, check_path): Animate a specific variable.
        parse_status_img(): Parse the status images.
        multi_var_img(var_1, var_2, file="inis.da"): Create an image with multiple variables.
        show_file_diff(file): Show the differences between two text files.
        cloud_text_comparison(): Compare text files in the specified paths and display the differences, if any.
        get_unequal_files(): Get the unequal files between two folders.
        parse_text_files(): Parse the text files.
    """

A run + image generation for all variables to all the simulated times would look like this:

    from cloudmodel import CloudModel
    
    CloudModel(
        simulation_time_minutes=45,
        save_time_minutes=3,
        statistic_time_minutes=3,
        bacup_time_minutes=3,
    )

    
    cloud = FileStyle(
        chosen_file="Nube",
        output_data_path="Data/new_code/",
        cmp_output_data_path="outputdata1/",
        img_path="img/new_code/",
        txt_path="txt/",
        cmp_txt_path="txt1/",
        vid_path="vid/",
        img_option="Contour",
        folder_handle="Delete",
    )
    cloud.parse_status_img()
    theta_base = cloud.get_var(cloud.var_list[3])
    cloud.show_var_dataframe(theta_base, 3)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cloudmodel-1.0.1-cp312-cp312-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12 musllinux: musl 1.2+ x86-64

cloudmodel-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

cloudmodel-1.0.1-cp311-cp311-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11 musllinux: musl 1.2+ x86-64

cloudmodel-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cloudmodel-1.0.1-cp310-cp310-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.2+ x86-64

cloudmodel-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

File details

Details for the file cloudmodel-1.0.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cloudmodel-1.0.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 19131c72b3d1f01d54a1d193b6731bb780872ab1684990d1eb73fb8c463b4244
MD5 ff47023f6c35f43ef9a8de9ad32eb5ce
BLAKE2b-256 5a5cc090447fe5c9d4f156de178e243cbf589d9c2b0b1054232eecd7c32b3e0e

See more details on using hashes here.

File details

Details for the file cloudmodel-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cloudmodel-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d67c72b006344a6b2ca8af0fc3828af1ea5c7e603f006d17de04dc132e13dc83
MD5 1e7ea307a101faeab3ba2dd711cfe4fb
BLAKE2b-256 4ef83479017908c729c2d9f4dba38247a15835152ceb0c8ba412fe94dd1131a8

See more details on using hashes here.

File details

Details for the file cloudmodel-1.0.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cloudmodel-1.0.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9508c110f65fad5c9db939cb012516bd3f93484dc00daa6b61dc37fba0081dbc
MD5 f75b19c376144930ce80b39e176a5469
BLAKE2b-256 e6fb5788297537e42ed795e2db455d4a34b18f0966dc545d89fca7bb8c039a30

See more details on using hashes here.

File details

Details for the file cloudmodel-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cloudmodel-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f7b8601eec8db68e5a540e9f7125a31b8b15955134a331a1fb1e6e85b0f4d36f
MD5 136ead8e43de89ac3c2da0e95dad5afe
BLAKE2b-256 d0059ebe7d55b302e92107f7ad9b9d6de2fdc9ca37107ad07df6f49ac51873a2

See more details on using hashes here.

File details

Details for the file cloudmodel-1.0.1-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cloudmodel-1.0.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cbe684f0dad735f85437f641c6c6f8a6ef810d2c03b5373e5d4abe7d0e09457a
MD5 9ab30ef6f54597dca0ddd6762763584a
BLAKE2b-256 5c837e1f2e5f0fd91ff89d977348a967d08568084f0f7b6e948e0d78944dbe69

See more details on using hashes here.

File details

Details for the file cloudmodel-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cloudmodel-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f054509ba35eda98094f3a362a8a03ffefb04b1c8274f09def10b6e481d9b8d
MD5 d7db99808c93379c973e31972d452ab3
BLAKE2b-256 91eba187fa678d53ecb87798b0c1dc64cb78e4ae874dabedd9f261cb89b4acac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page