Skip to content

Packaged code for PyPI by guanpu #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
guanpu_diffusion2d/_version.py export-subst
9 changes: 9 additions & 0 deletions .pypirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[distutils]
index-servers =
pypi
testpypi

[testpypi]
repository = https://test.pypi.org/legacy/
username = guanpu
password = pypi-AgENdGVzdC5weXBpLm9yZwIkYmQzNTBlZTMtNjgxYy00ZmJkLWIyM2UtMGUyMDI4YTNkMTRjAAIqWzMsIjIyZDk3MDFjLWU3MmItNDcxZi05NzQxLWU0MDczYjU4OWMzMyJdAAAGIKXDLONotzVjaQFRGcDfABxQvzSkZ1M9qNQXtBOWahc-
51 changes: 45 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,58 @@
# diffusion2D

## Instructions for students
## Instructions for Students

Please follow the instructions in [pypi_exercise.md](https://github.com/Simulation-Software-Engineering/Lecture-Material/blob/main/03_building_and_packaging/pypi_exercise.md).

The code used in this exercise is based on [Chapter 7 of the book "Learning Scientific Programming with Python"](https://scipython.com/book/chapter-7-matplotlib/examples/the-two-dimensional-diffusion-equation/).

## Project description
---

## Installing the package
## Project Description

### Using pip3 to install from PyPI
The `diffusion2D` project simulates the 2D heat diffusion equation using a finite difference method. It demonstrates how heat diffuses over a square plate with customizable parameters, such as thermal diffusivity, grid resolution, and initial temperature distribution.

### Required dependencies
The project is modular, with clear separation of the solver and plotting functions. It serves as an exercise for learning Python packaging and distribution techniques.

## Running this package
---

## Installing the Package

### Using pip3 to Install from PyPI

Once the package is published to PyPI, you can install it with:

```bash
pip install -i https://test.pypi.org/simple/ guanpu-diffusion2d
```

### Required Dependencies

The following dependencies are required to use this package:

- **Python** >= 3.6
- **NumPy**
- **Matplotlib**

These dependencies will be installed automatically if you use `pip` to install the package.

---

## Running this Package

After installing the package, you can run the 2D diffusion simulation directly by importing and calling the `solve()` function:

```python
from guanpu_diffusion2d import diffusion2d

# Run the simulation with default parameters
diffusion2d.solve()

# Customize parameters (e.g., grid size, thermal diffusivity)
diffusion2d.solve(dx=0.05, dy=0.05, D=2.0)
```

---

## Citing
just cite plz
81 changes: 0 additions & 81 deletions diffusion2d.py

This file was deleted.

6 changes: 6 additions & 0 deletions guanpu_diffusion2d/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions

from . import _version
__version__ = _version.get_versions()['version']
Loading